aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
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
parent183e31ade1f776cc92341ca347efbcba48314163 (diff)
fixed crashing on unparsed jids
Diffstat (limited to '')
-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 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;