From c32162c2808a9bdef841cae706a8de9bcf5391a1 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 23 Jul 2015 14:02:25 +0200 Subject: [PATCH] switch/case can't deal with null pointers --- .../java/eu/siacs/conversations/xmpp/stanzas/IqPacket.java | 3 +++ 1 file changed, 3 insertions(+) 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 7b36fc497..398102e12 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;