fixed potential npes in message parser

This commit is contained in:
iNPUTmice 2014-12-02 23:59:40 +01:00
parent 241de062da
commit 9152e1ac95
1 changed files with 7 additions and 2 deletions

View File

@ -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;