diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-12-15 17:36:16 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-12-15 17:36:16 +0100 |
commit | ab2187dbdfa048102dd6e38c73f35c518b90a526 (patch) | |
tree | 6f55befc57c9aecc005c5c4ca83319e4579b51f6 /src/main | |
parent | 183e31ade1f776cc92341ca347efbcba48314163 (diff) |
fixed crashing on unparsed jids
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/eu/siacs/conversations/parser/MessageParser.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index cd4c6401..e9d491b5 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -60,12 +60,12 @@ public class MessageParser extends AbstractParser implements } private Message parseOtrChat(MessagePacket packet, Account account) { - boolean properlyAddressed = (!packet.getTo().isBareJid()) - || (account.countPresences() == 1); - final Jid from = packet.getFrom(); - if (from == null) { + final Jid to = packet.getTo(); + final Jid from = packet.getFrom(); + if (to == null || from == null) { return null; } + boolean properlyAddressed = !to.isBareJid() || account.countPresences() == 1; Conversation conversation = mXmppConnectionService .findOrCreateConversation(account, from.toBareJid(), false); String presence; |