From cc34c60255c4b7c055491d291f0f81f5191caa06 Mon Sep 17 00:00:00 2001 From: Sam Whited Date: Fri, 7 Nov 2014 22:36:30 -0500 Subject: Don't crash on packets with no "from" specified --- src/main/java/eu/siacs/conversations/parser/PresenceParser.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/java/eu/siacs') diff --git a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java index 8393585e..ba3f1645 100644 --- a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java +++ b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java @@ -22,7 +22,8 @@ public class PresenceParser extends AbstractParser implements public void parseConferencePresence(PresencePacket packet, Account account) { PgpEngine mPgpEngine = mXmppConnectionService.getPgpEngine(); if (packet.hasChild("x", "http://jabber.org/protocol/muc#user")) { - final Conversation muc = mXmppConnectionService.find(account, + final Conversation muc = packet.getFrom() == null ? null : mXmppConnectionService.find( + account, packet.getFrom().toBareJid()); if (muc != null) { boolean before = muc.getMucOptions().online(); -- cgit v1.2.3