aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-07-02 18:02:32 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-07-03 22:35:35 +0200
commit96fe75fe9f7e143268e6306fd799eceaad85c48d (patch)
tree5e029d24199531ce2a749478cbabeecb4dc726bf
parentbfe1d2489ae41f21c2899c6eea4273357a6aa20b (diff)
moved null check for to and from in message parser
-rw-r--r--src/main/java/eu/siacs/conversations/parser/MessageParser.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
index 5a40b170..864d0667 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;