diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 4792c57374..d26a7d5556 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -1364,8 +1364,11 @@ class Core { try { Folder[] isubscribed = defaultFolder.listSubscribed("*"); for (Folder ifolder : isubscribed) { - subscription.add(ifolder.getFullName()); - Log.i("Subscribed " + defaultFolder.getFullName() + ":" + ifolder.getFullName()); + String fullName = ifolder.getFullName(); + if (TextUtils.isEmpty(fullName)) + continue; + subscription.add(fullName); + Log.i("Subscribed " + defaultFolder.getFullName() + ":" + fullName); } } catch (MessagingException ex) { Log.e(account.name, ex); @@ -1387,8 +1390,11 @@ class Core { try { Folder[] isubscribed = namespace.listSubscribed("*"); for (Folder ifolder : isubscribed) { - subscription.add(ifolder.getFullName()); - Log.i("Subscribed " + namespace.getFullName() + ":" + ifolder.getFullName()); + String fullName = ifolder.getFullName(); + if (TextUtils.isEmpty(fullName)) + continue; + subscription.add(fullName); + Log.i("Subscribed " + namespace.getFullName() + ":" + fullName); } } catch (MessagingException ex) { Log.e(account.name, ex); @@ -1409,6 +1415,11 @@ class Core { Map> parentFolders = new HashMap<>(); for (Folder ifolder : ifolders) { String fullName = ifolder.getFullName(); + if (TextUtils.isEmpty(fullName)) { + Log.e("Folder name empty"); + continue; + } + String[] attrs = ((IMAPFolder) ifolder).getAttributes(); String type = EntityFolder.getType(attrs, fullName, false); boolean subscribed = subscription.contains(fullName);