From ddab7292e5496e86ae033a3a36c86bf0b782b8f6 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Wed, 24 Oct 2018 20:44:44 +0200 Subject: try to catch a NPE on iterator.remove --- .../de/pixart/messenger/services/XmppConnectionService.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index f47893e48..3588f836b 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -2629,9 +2629,13 @@ public class XmppConnectionService extends Service { for (ListIterator iterator = cryptoTargets.listIterator(); iterator.hasNext(); ) { Jid jid = iterator.next(); if (!members.contains(jid) && !members.contains(Jid.ofDomain(jid.getDomain()))) { - iterator.remove(); - Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": removed " + jid + " from crypto targets of " + conversation.getName()); - changed = true; + try { + iterator.remove(); + Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": removed " + jid + " from crypto targets of " + conversation.getName()); + changed = true; + } catch (Exception e) { + e.printStackTrace(); + } } } if (changed) { -- cgit v1.2.3