fixed crashing on unparsed jids

This commit is contained in:
iNPUTmice 2014-12-15 17:36:16 +01:00
parent 183e31ade1
commit ab2187dbdf
1 changed files with 4 additions and 4 deletions

View File

@ -60,12 +60,12 @@ public class MessageParser extends AbstractParser implements
} }
private Message parseOtrChat(MessagePacket packet, Account account) { private Message parseOtrChat(MessagePacket packet, Account account) {
boolean properlyAddressed = (!packet.getTo().isBareJid()) final Jid to = packet.getTo();
|| (account.countPresences() == 1);
final Jid from = packet.getFrom(); final Jid from = packet.getFrom();
if (from == null) { if (to == null || from == null) {
return null; return null;
} }
boolean properlyAddressed = !to.isBareJid() || account.countPresences() == 1;
Conversation conversation = mXmppConnectionService Conversation conversation = mXmppConnectionService
.findOrCreateConversation(account, from.toBareJid(), false); .findOrCreateConversation(account, from.toBareJid(), false);
String presence; String presence;