diff --git a/source/org/jivesoftware/smack/PacketReader.java b/source/org/jivesoftware/smack/PacketReader.java index e8caece17..be6c0862c 100644 --- a/source/org/jivesoftware/smack/PacketReader.java +++ b/source/org/jivesoftware/smack/PacketReader.java @@ -55,6 +55,7 @@ package org.jivesoftware.smack; import org.xmlpull.v1.*; import java.util.*; import org.jivesoftware.smack.packet.*; +import org.jivesoftware.smack.packet.Error; import org.jivesoftware.smack.filter.PacketFilter; /** @@ -156,6 +157,9 @@ public class PacketReader { done = true; } + /** + * Process listeners. + */ private void processListeners() { boolean processedPacket = false; while (true) { @@ -236,6 +240,9 @@ public class PacketReader { * @param packet the packet to process. */ private void processPacket(Packet packet) { + if (packet == null) { + return; + } // Loop through all collectors and notify the appropriate ones. synchronized (collectors) { // Loop through packet collectors backwards. @@ -258,36 +265,26 @@ public class PacketReader { * @throws Exception if an exception occurs while parsing the packet. */ private static Packet parseIQ(XmlPullParser parser) throws Exception { - String id = null; - String to = null; - String from = null; - IQ.Type type = null; - // Parse attributes of the opening iq tag. - for (int i=0; i