diff options
author | cyberta <cyberta@riseup.net> | 2020-01-30 16:06:30 -0600 |
---|---|---|
committer | cyberta <cyberta@riseup.net> | 2020-01-30 16:06:30 -0600 |
commit | b9e4195573da146d48e5921c65dc57273d94ccd2 (patch) | |
tree | b78065782c472273e66eaba073e8f9a0fa63b0a9 /app/src/main/java/se/leap/bitmaskclient/firewall | |
parent | 7a42047640daef05f5771d8cb812a03ee14bbec6 (diff) |
fix possible NPE in SetupTetheringTask
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/firewall')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/firewall/SetupTetheringTask.java | 5 |
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; } |