From c32162c2808a9bdef841cae706a8de9bcf5391a1 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 23 Jul 2015 14:02:25 +0200 Subject: switch/case can't deal with null pointers --- src/main/java/eu/siacs/conversations/xmpp/stanzas/IqPacket.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main/java/eu/siacs') diff --git a/src/main/java/eu/siacs/conversations/xmpp/stanzas/IqPacket.java b/src/main/java/eu/siacs/conversations/xmpp/stanzas/IqPacket.java index 7b36fc49..398102e1 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/stanzas/IqPacket.java +++ b/src/main/java/eu/siacs/conversations/xmpp/stanzas/IqPacket.java @@ -39,6 +39,9 @@ public class IqPacket extends AbstractStanza { public TYPE getType() { final String type = getAttribute("type"); + if (type == null) { + return TYPE.INVALID; + } switch (type) { case "error": return TYPE.ERROR; -- cgit v1.2.3