diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-02-22 20:15:37 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-02-22 20:49:04 +0100 |
commit | 13222d1b6a326b8477f2b80bfe583e41b2e33686 (patch) | |
tree | 4e9111e3b21b6fa51db278033233d038843797a3 /src/main | |
parent | 696a54b5f286679d7b77e47c1fedcff0f3c4e259 (diff) |
npe checks
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/XmppConnectionService.java | 5 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/xmpp/XmppConnection.java | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index 43aa7c292..7736aa0ba 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -3163,7 +3163,10 @@ public class XmppConnectionService extends Service { disconnect(account, force || account.getTrueStatus().isError() || !hasInternet); account.getRoster().clearPresences(); connection.resetEverything(); - account.getAxolotlService().resetBrokenness(); + final AxolotlService axolotlService = account.getAxolotlService(); + if (axolotlService != null) { + axolotlService.resetBrokenness(); + } if (!hasInternet) { account.setStatus(Account.State.NO_INTERNET); } diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java index 0e05a2775..4a93d1eb6 100644 --- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java +++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java @@ -102,7 +102,7 @@ public class XmppConnection implements Runnable { private final WakeLock wakeLock; private Socket socket; private XmlReader tagReader; - private TagWriter tagWriter; + private TagWriter tagWriter = new TagWriter(); private final Features features = new Features(this); private boolean needsBinding = true; private boolean shouldAuthenticate = true; @@ -480,7 +480,9 @@ public class XmppConnection implements Runnable { } this.socket = socket; tagReader = new XmlReader(wakeLock); - if (tagWriter != null) tagWriter.forceClose(); + if (tagWriter != null) { + tagWriter.forceClose(); + } tagWriter = new TagWriter(); tagWriter.setOutputStream(socket.getOutputStream()); tagReader.setInputStream(socket.getInputStream()); |