From 1b364755df91a8a74040103963f2d03c2ace0a0e Mon Sep 17 00:00:00 2001 From: cketti Date: Tue, 29 Aug 2017 18:12:58 +0200 Subject: [PATCH] Simplify logic in ActivityListener.getActionInProgressOperation() --- .../java/com/fsck/k9/activity/ActivityListener.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/k9mail/src/main/java/com/fsck/k9/activity/ActivityListener.java b/k9mail/src/main/java/com/fsck/k9/activity/ActivityListener.java index 04eebdd44..93631085d 100644 --- a/k9mail/src/main/java/com/fsck/k9/activity/ActivityListener.java +++ b/k9mail/src/main/java/com/fsck/k9/activity/ActivityListener.java @@ -83,12 +83,13 @@ public class ActivityListener extends SimpleMessagingListener { } else { displayName = loadingFolderName; } - if (account != null && account.getInboxFolderName() != null && - account.getInboxFolderName().equalsIgnoreCase(displayName)) { - displayName = context.getString(R.string.special_mailbox_name_inbox); - } else if (account != null && account.getOutboxFolderName() != null && - account.getOutboxFolderName().equals(displayName)) { - displayName = context.getString(R.string.special_mailbox_name_outbox); + + if (account != null) { + if (displayName.equalsIgnoreCase(account.getInboxFolderName())) { + displayName = context.getString(R.string.special_mailbox_name_inbox); + } else if (displayName.equalsIgnoreCase(account.getOutboxFolderName())) { + displayName = context.getString(R.string.special_mailbox_name_outbox); + } } if (loadingHeaderFolderName != null) {