aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-12-15 17:36:16 +0100
committeriNPUTmice <daniel@gultsch.de>2014-12-15 17:36:16 +0100
commitab2187dbdfa048102dd6e38c73f35c518b90a526 (patch)
tree6f55befc57c9aecc005c5c4ca83319e4579b51f6 /src/main/java/eu/siacs/conversations
parent183e31ade1f776cc92341ca347efbcba48314163 (diff)
fixed crashing on unparsed jids
Diffstat (limited to 'src/main/java/eu/siacs/conversations')
-rw-r--r--src/main/java/eu/siacs/conversations/parser/MessageParser.java8
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 cd4c6401a..e9d491b5f 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;