From 0b125701330e297ff4f7bc783161187db4ed8aa5 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 15 May 2019 10:46:59 +0200 Subject: [PATCH] Fixed crash --- .../main/java/eu/faircode/email/FragmentAccount.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentAccount.java b/app/src/main/java/eu/faircode/email/FragmentAccount.java index 8c7998f682..fa7ab3459e 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccount.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccount.java @@ -1425,16 +1425,17 @@ public class FragmentAccount extends FragmentBase { vwColor.setBackground(border); } - private void setFolders(List folders, EntityAccount account) { + private void setFolders(List _folders, EntityAccount account) { + List folders = new ArrayList<>(); + for (EntityFolder folder : _folders) + if (!EntityFolder.INBOX.equals(folder.type)) + folders.add(folder); + EntityFolder none = new EntityFolder(); none.id = -1L; none.name = "-"; folders.add(0, none); - for (EntityFolder folder : new ArrayList<>(folders)) - if (EntityFolder.INBOX.equals(folder.type)) - folders.remove(folder); - adapter.addAll(folders); Long left = (account == null ? null : account.swipe_left);