aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-10-29 14:38:35 +0100
committerDaniel Gultsch <daniel@gultsch.de>2015-10-29 14:38:35 +0100
commitef7857ac8da2a5c604ff48620e2480e4aa52661f (patch)
treee7114f83cdd7462cfe163cff47f48052d42f33a9 /src
parentc7ff196f58b5576ca1aeb5fd6d51bbe500754f06 (diff)
avoid npe when checking for stream restart
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
index 1549aeb5d..04c0f625e 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -360,7 +360,8 @@ public class XmppConnection implements Runnable {
String.valueOf(saslMechanism.getPriority()));
tagReader.reset();
sendStartStream();
- if (tagReader.readTag().isStart("stream")) {
+ final Tag tag = tagReader.readTag();
+ if (tag != null && tag.isStart("stream")) {
processStream();
} else {
throw new IOException("server didn't restart stream after successful auth");
@@ -647,7 +648,8 @@ public class XmppConnection implements Runnable {
sendStartStream();
Log.d(Config.LOGTAG, account.getJid().toBareJid()+ ": TLS connection established");
features.encryptionEnabled = true;
- if (tagReader.readTag().isStart("stream")) {
+ final Tag tag = tagReader.readTag();
+ if (tag != null && tag.isStart("stream")) {
processStream();
} else {
throw new IOException("server didn't restart stream after STARTTLS");