diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/XmppConnectionService.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index 73c5039c6..a98f84336 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -1560,9 +1560,15 @@ public class XmppConnectionService extends Service { accountLookupTable.put(account.getUuid(), account); } this.conversations.addAll(databaseBackend.getConversations(Conversation.STATUS_AVAILABLE)); - for (Conversation conversation : this.conversations) { + for (Iterator<Conversation> iterator = conversations.listIterator(); iterator.hasNext(); ) { + Conversation conversation = iterator.next(); Account account = accountLookupTable.get(conversation.getAccountUuid()); - conversation.setAccount(account); + if (account != null) { + conversation.setAccount(account); + } else { + Log.e(Config.LOGTAG, "unable to restore Conversations with " + conversation.getJid()); + iterator.remove(); + } } Runnable runnable = new Runnable() { @Override |