summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2022-05-18 11:13:24 +0200
committercyBerta <cyberta@riseup.net>2022-05-18 11:13:24 +0200
commit5de151dc62caa499157224620ed05bfda5f6d612 (patch)
tree9ce584fa8925896016a354e92ff18e63b2f74cc6 /app
parent8301b4bc5b24561b77d3381ea2e8ff8c72368669 (diff)
avoid possible NPE in ClientTransportPlugin
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/tor/ClientTransportPlugin.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/tor/ClientTransportPlugin.java b/app/src/main/java/se/leap/bitmaskclient/tor/ClientTransportPlugin.java
index 0b481780..59c1290a 100644
--- a/app/src/main/java/se/leap/bitmaskclient/tor/ClientTransportPlugin.java
+++ b/app/src/main/java/se/leap/bitmaskclient/tor/ClientTransportPlugin.java
@@ -113,13 +113,16 @@ public class ClientTransportPlugin implements ClientTransportPluginInterface {
@Override
public void stop() {
IPtProxy.stopSnowflake();
- try {
+ try {
TorStatusObservable.waitUntil(this::isSnowflakeOff, 10);
} catch (InterruptedException | TimeoutException e) {
e.printStackTrace();
}
snowflakePort = -1;
- logFileObserver.stopWatching();
+ if (logFileObserver != null) {
+ logFileObserver.stopWatching();
+ logFileObserver = null;
+ }
}
private boolean isSnowflakeOff() {