summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2022-05-19 16:26:51 +0200
committercyBerta <cyberta@riseup.net>2022-05-19 16:26:51 +0200
commit7923e2bf9de7cec0a7cd2e428655a93c33f7c5aa (patch)
treed5d7828c120c989014e5865fd9692b32278a6e61 /app/src/main/java/se/leap
parent464b9e44cd491c75479b13448b001ed2a64dcf9c (diff)
avoid possible NPE in TorStatusObservable
Diffstat (limited to 'app/src/main/java/se/leap')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/tor/TorStatusObservable.java4
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);