From b9e4195573da146d48e5921c65dc57273d94ccd2 Mon Sep 17 00:00:00 2001 From: cyberta Date: Thu, 30 Jan 2020 16:06:30 -0600 Subject: fix possible NPE in SetupTetheringTask --- .../main/java/se/leap/bitmaskclient/firewall/SetupTetheringTask.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/src') 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 { 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; } -- cgit v1.2.3