aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-12-02 23:59:40 +0100
committeriNPUTmice <daniel@gultsch.de>2014-12-03 00:06:57 +0100
commit9152e1ac95bb51de2189791a552c703cbca59f24 (patch)
tree0ed8319ac45ce0a091aca7032bc43fb919c86993 /src/main/java/eu/siacs/conversations
parent241de062dad6376e5320138a870d9c0642f52126 (diff)
fixed potential npes in message parser
Diffstat (limited to 'src/main/java/eu/siacs/conversations')
-rw-r--r--src/main/java/eu/siacs/conversations/parser/MessageParser.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
index e2028c7bc..8e559bd5f 100644
--- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java
+++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
@@ -27,8 +27,10 @@ public class MessageParser extends AbstractParser implements
private Message parseChat(MessagePacket packet, Account account) {
final Jid jid = packet.getFrom();
- Conversation conversation = mXmppConnectionService
- .findOrCreateConversation(account, jid.toBareJid(), false);
+ if (jid == null) {
+ return null;
+ }
+ Conversation conversation = mXmppConnectionService.findOrCreateConversation(account, jid.toBareJid(), false);
updateLastseen(packet, account, true);
String pgpBody = getPgpBody(packet);
Message finishedMessage;
@@ -61,6 +63,9 @@ public class MessageParser extends AbstractParser implements
boolean properlyAddressed = (!packet.getTo().isBareJid())
|| (account.countPresences() == 1);
final Jid from = packet.getFrom();
+ if (from == null) {
+ return null;
+ }
Conversation conversation = mXmppConnectionService
.findOrCreateConversation(account, from.toBareJid(), false);
String presence;