Added fail safe

pull/207/head
M66B 3 years ago
parent 21cfc7a0b5
commit baa2bdcdaf

@ -126,15 +126,17 @@ public class EmailProvider implements Parcelable {
executor.submit(new Runnable() { executor.submit(new Runnable() {
@Override @Override
public void run() { public void run() {
File file = new File(context.getFilesDir(), "providers.xml"); try {
if (file.exists()) { File file = new File(context.getFilesDir(), "providers.xml");
try (FileInputStream is = new FileInputStream(file)) { if (file.exists()) {
XmlPullParser parser = Xml.newPullParser(); try (FileInputStream is = new FileInputStream(file)) {
parser.setInput(is, null); XmlPullParser parser = Xml.newPullParser();
imported = parseProfiles(parser); parser.setInput(is, null);
} catch (Throwable ex) { imported = parseProfiles(parser);
Log.e(ex); }
} }
} catch (Throwable ex) {
Log.e(ex);
} }
} }
}); });

Loading…
Cancel
Save