mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-24 23:32:05 +01:00
Fix NPE in ChatManager: Check if null
bareJidChats is a ConcurrentHashMap which does not allow 'null' keys, thus get(null) returns a NPE. And asEntityBareJidIfPossible may return 'null', this could happen.
This commit is contained in:
parent
b849d4102b
commit
19469b0faf
1 changed files with 4 additions and 1 deletions
|
@ -322,7 +322,10 @@ public final class ChatManager extends Manager{
|
|||
Chat match = jidChats.get(userJID);
|
||||
|
||||
if (match == null && (matchMode == MatchMode.BARE_JID)) {
|
||||
match = baseJidChats.get(userJID.asEntityBareJidIfPossible());
|
||||
EntityBareJid entityBareJid = userJID.asEntityBareJidIfPossible();
|
||||
if (entityBareJid != null) {
|
||||
match = baseJidChats.get(entityBareJid);
|
||||
}
|
||||
}
|
||||
return match;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue