Browse Source

fix: missing null check on refactor notification

main
Distopico Vegan 6 years ago
parent
commit
3318b38b5c
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      app/src/main/java/org/dystopia/email/ServiceSynchronize.java

+ 5
- 5
app/src/main/java/org/dystopia/email/ServiceSynchronize.java View File

@ -189,11 +189,11 @@ public class ServiceSynchronize extends LifecycleService {
Long accountKey = message.account; Long accountKey = message.account;
List<TupleNotification> msgList = new ArrayList<>(); List<TupleNotification> msgList = new ArrayList<>();
if (messagesByAccount.indexOfKey(accountKey) != -1) {
msgList = messagesByAccount.get(accountKey);
if (messagesByAccount.indexOfKey(accountKey) >= 0) {
msgList = messagesByAccount.get(accountKey, msgList);
} }
if (accounts.indexOfKey(accountKey) == -1) {
if (accounts.indexOfKey(accountKey) < 0) {
accounts.put(accountKey, accounts.put(accountKey,
new Pair<String, Integer>(message.accountName, message.accountColor)); new Pair<String, Integer>(message.accountName, message.accountColor));
} }
@ -213,7 +213,7 @@ public class ServiceSynchronize extends LifecycleService {
List<Integer> toRemove = new ArrayList<>(); List<Integer> toRemove = new ArrayList<>();
String tag = "unseen-" + accountId; String tag = "unseen-" + accountId;
if (notifying.indexOfKey(accountId) != -1) {
if (notifying.indexOfKey(accountId) >= 0) {
toRemove = notifying.get(accountId); toRemove = notifying.get(accountId);
} }
@ -539,7 +539,7 @@ public class ServiceSynchronize extends LifecycleService {
List<Notification> notifications = new ArrayList<>(); List<Notification> notifications = new ArrayList<>();
Integer size = messages.size(); Integer size = messages.size();
if (size == 0) {
if (size == 0 || account == null) {
return notifications; return notifications;
} }


Loading…
Cancel
Save