do not crash when inner message contains invalid jid

This commit is contained in:
Daniel Gultsch 2018-04-28 16:56:32 +02:00
parent b1b7cf5c0a
commit 9963616270

View file

@ -293,8 +293,8 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
}
boolean notify = false;
if (from == null) {
Log.d(Config.LOGTAG, "no from in: " + packet.toString());
if (from == null || !InvalidJid.isValid(from) || !InvalidJid.isValid(to)) {
Log.e(Config.LOGTAG, "encountered invalid message from='" + from + "' to='" + to + "'");
return;
}