diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2014-05-23 10:15:58 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2014-05-23 10:15:58 +0200 |
commit | 8133dcd881af0d89b0ed32d7da944b425975597a (patch) | |
tree | a15e972238f00af82714da22fc3a31f47dff900a /src/eu/siacs/conversations | |
parent | a5d54d70eed7f8c6ddfbd6f4627d0f497aabcb37 (diff) |
fixed possible npe
Diffstat (limited to '')
-rw-r--r-- | src/eu/siacs/conversations/xmpp/XmppConnection.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/xmpp/XmppConnection.java b/src/eu/siacs/conversations/xmpp/XmppConnection.java index fa4fa10a..a1aaf66a 100644 --- a/src/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/eu/siacs/conversations/xmpp/XmppConnection.java @@ -330,6 +330,9 @@ public class XmppConnection implements Runnable { } element.setAttributes(currentTag.getAttributes()); Tag nextTag = tagReader.readTag(); + if (nextTag==null) { + throw new IOException("interrupted mid tag"); + } while (!nextTag.isEnd(element.getName())) { if (!nextTag.isNo()) { Element child = tagReader.readElement(nextTag); @@ -341,6 +344,9 @@ public class XmppConnection implements Runnable { element.addChild(child); } nextTag = tagReader.readTag(); + if (nextTag==null) { + throw new IOException("interrupted mid tag"); + } } ++stanzasReceived; lastPaketReceived = SystemClock.elapsedRealtime(); |