summaryrefslogtreecommitdiff
path: root/app/src/main/java/se
diff options
context:
space:
mode:
authorcyberta <cyberta@riseup.net>2020-01-30 16:06:30 -0600
committercyberta <cyberta@riseup.net>2020-01-30 16:06:30 -0600
commitb9e4195573da146d48e5921c65dc57273d94ccd2 (patch)
treeb78065782c472273e66eaba073e8f9a0fa63b0a9 /app/src/main/java/se
parent7a42047640daef05f5771d8cb812a03ee14bbec6 (diff)
fix possible NPE in SetupTetheringTask
Diffstat (limited to 'app/src/main/java/se')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/firewall/SetupTetheringTask.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/firewall/SetupTetheringTask.java b/app/src/main/java/se/leap/bitmaskclient/firewall/SetupTetheringTask.java
index 8bb197b1..49febc24 100644
--- a/app/src/main/java/se/leap/bitmaskclient/firewall/SetupTetheringTask.java
+++ b/app/src/main/java/se/leap/bitmaskclient/firewall/SetupTetheringTask.java
@@ -52,7 +52,10 @@ public class SetupTetheringTask extends AsyncTask<Void, Boolean, Boolean> {
try {
boolean hasBitmaskChain = runBlockingCmd(bitmaskChain, log) == 0;
boolean allowSu = log.toString().contains("uid=0");
- callbackWeakReference.get().onSuRequested(allowSu);
+ FirewallCallback callback = callbackWeakReference.get();
+ if (callback != null) {
+ callback.onSuRequested(allowSu);
+ }
if (!allowSu) {
return false;
}