From baa2bdcdaf64bc04662c35f2ca1d4070efa3415a Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 22 Mar 2022 14:22:18 +0100 Subject: [PATCH] Added fail safe --- .../java/eu/faircode/email/EmailProvider.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/EmailProvider.java b/app/src/main/java/eu/faircode/email/EmailProvider.java index 789598d1a2..6778633920 100644 --- a/app/src/main/java/eu/faircode/email/EmailProvider.java +++ b/app/src/main/java/eu/faircode/email/EmailProvider.java @@ -126,15 +126,17 @@ public class EmailProvider implements Parcelable { executor.submit(new Runnable() { @Override public void run() { - File file = new File(context.getFilesDir(), "providers.xml"); - if (file.exists()) { - try (FileInputStream is = new FileInputStream(file)) { - XmlPullParser parser = Xml.newPullParser(); - parser.setInput(is, null); - imported = parseProfiles(parser); - } catch (Throwable ex) { - Log.e(ex); + try { + File file = new File(context.getFilesDir(), "providers.xml"); + if (file.exists()) { + try (FileInputStream is = new FileInputStream(file)) { + XmlPullParser parser = Xml.newPullParser(); + parser.setInput(is, null); + imported = parseProfiles(parser); + } } + } catch (Throwable ex) { + Log.e(ex); } } });