diff options
author | cyBerta <cyberta@riseup.net> | 2022-05-19 16:26:51 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2022-05-19 16:26:51 +0200 |
commit | 7923e2bf9de7cec0a7cd2e428655a93c33f7c5aa (patch) | |
tree | d5d7828c120c989014e5865fd9692b32278a6e61 /app/src/main/java/se | |
parent | 464b9e44cd491c75479b13448b001ed2a64dcf9c (diff) |
avoid possible NPE in TorStatusObservable
Diffstat (limited to 'app/src/main/java/se')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/tor/TorStatusObservable.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/tor/TorStatusObservable.java b/app/src/main/java/se/leap/bitmaskclient/tor/TorStatusObservable.java index 239bd528..7eee1a9d 100644 --- a/app/src/main/java/se/leap/bitmaskclient/tor/TorStatusObservable.java +++ b/app/src/main/java/se/leap/bitmaskclient/tor/TorStatusObservable.java @@ -263,6 +263,10 @@ public class TorStatusObservable extends Observable { } public static String getStringForCurrentStatus(Context context) { + if (context == null) { + return ""; + } + switch (getInstance().status) { case ON: return context.getString(R.string.tor_started); |