diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java b/smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java
index f702052fd..4c9ce0699 100644
--- a/smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java
+++ b/smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java
@@ -290,8 +290,6 @@ public class PacketParserUtils {
break outerloop;
}
break;
- case XmlPullParser.TEXT:
- throw new IllegalStateException("Invalid Stanza: Must not contain text or mixed content as direct child of ");
}
}
@@ -592,8 +590,6 @@ public class PacketParserUtils {
break outerloop;
}
break;
- case XmlPullParser.TEXT:
- throw new IllegalStateException("Invalid Stanza: Must not contain text or mixed content as direct child of ");
}
}
return presence;
@@ -650,8 +646,6 @@ public class PacketParserUtils {
break outerloop;
}
break;
- case XmlPullParser.TEXT:
- throw new IllegalStateException("Invalid Stanza: Must not contain text or mixed content as direct child of ");
}
}
// Decide what to do when an IQ packet was not understood
diff --git a/smack-core/src/test/java/org/jivesoftware/smack/util/PacketParserUtilsTest.java b/smack-core/src/test/java/org/jivesoftware/smack/util/PacketParserUtilsTest.java
index e24196d15..117e9e3c1 100644
--- a/smack-core/src/test/java/org/jivesoftware/smack/util/PacketParserUtilsTest.java
+++ b/smack-core/src/test/java/org/jivesoftware/smack/util/PacketParserUtilsTest.java
@@ -710,8 +710,8 @@ public class PacketParserUtilsTest {
try {
PacketParserUtils.parseMessage(PacketParserUtils.getParserFor(invalidControl));
fail("Exception should be thrown");
- } catch(IllegalStateException e) {
- assertTrue(e.getMessage().contains("Invalid Stanza"));
+ } catch(XmlPullParserException e) {
+ assertTrue(e.getMessage().contains("end tag name