diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/MucOptions.java | 2 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/services/XmppConnectionService.java | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/MucOptions.java b/src/main/java/de/pixart/messenger/entities/MucOptions.java index e73fcfcac..40a0be58d 100644 --- a/src/main/java/de/pixart/messenger/entities/MucOptions.java +++ b/src/main/java/de/pixart/messenger/entities/MucOptions.java @@ -336,7 +336,7 @@ public class MucOptions { } public boolean isContactInRoom(Contact contact) { - return findUserByRealJid(contact.getJid().asBareJid()) != null; + return contact != null && findUserByRealJid(contact.getJid().asBareJid()) != null; } public boolean isUserInRoom(Jid jid) { diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index 0ead8c393..e7c587107 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -2198,9 +2198,13 @@ public class XmppConnectionService extends Service { * This will find all conferences with the contact as member and also the conference that is the contact (that 'fake' contact is used to store the avatar) */ public List<Conversation> findAllConferencesWith(Contact contact) { - ArrayList<Conversation> results = new ArrayList<>(); + final ArrayList<Conversation> results = new ArrayList<>(); for (final Conversation c : conversations) { - if (c.getMode() == Conversation.MODE_MULTI && (c.getJid().asBareJid().equals(contact.getJid().asBareJid()) || c.getMucOptions().isContactInRoom(contact))) { + if (c.getMode() != Conversation.MODE_MULTI) { + continue; + } + final MucOptions mucOptions = c.getMucOptions(); + if (c.getJid().asBareJid().equals(contact.getJid().asBareJid()) || (mucOptions != null && mucOptions.isContactInRoom(contact))) { results.add(c); } } |