From a2525346f461183125c5840498228c347a86d4aa Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 2 Jul 2015 18:02:32 +0200 Subject: moved null check for to and from in message parser --- .../java/eu/siacs/conversations/parser/MessageParser.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/main/java/eu/siacs') diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index d1b8c03a..72f822ca 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -239,6 +239,12 @@ public class MessageParser extends AbstractParser implements final Jid to = packet.getTo(); final Jid from = packet.getFrom(); final String remoteMsgId = packet.getId(); + + if (from == null || to == null) { + Log.d(Config.LOGTAG,"no to or from in: "+packet.toString()); + return; + } + boolean isTypeGroupChat = packet.getType() == MessagePacket.TYPE_GROUPCHAT; boolean isProperlyAddressed = !to.isBareJid() || account.countPresences() == 1; boolean isMucStatusMessage = from.isBareJid() && mucUserElement != null && mucUserElement.hasChild("status"); @@ -250,11 +256,6 @@ public class MessageParser extends AbstractParser implements counterpart = from; } - if (from == null || to == null) { - Log.d(Config.LOGTAG,"no to or from in: "+packet.toString()); - return; - } - Invite invite = extractInvite(packet); if (invite != null && invite.execute(account)) { return; -- cgit v1.2.3