summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/ConfigHelper.java2
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/ProviderApiBase.java11
2 files changed, 12 insertions, 1 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/ConfigHelper.java b/app/src/main/java/se/leap/bitmaskclient/ConfigHelper.java
index 4929f040..33b2e225 100644
--- a/app/src/main/java/se/leap/bitmaskclient/ConfigHelper.java
+++ b/app/src/main/java/se/leap/bitmaskclient/ConfigHelper.java
@@ -47,7 +47,7 @@ public class ConfigHelper {
} else {
return false;
}
- } catch (JSONException e) {
+ } catch (NullPointerException | JSONException e) {
return false;
}
}
diff --git a/app/src/main/java/se/leap/bitmaskclient/ProviderApiBase.java b/app/src/main/java/se/leap/bitmaskclient/ProviderApiBase.java
index caa48231..bf1c3941 100644
--- a/app/src/main/java/se/leap/bitmaskclient/ProviderApiBase.java
+++ b/app/src/main/java/se/leap/bitmaskclient/ProviderApiBase.java
@@ -687,6 +687,17 @@ public abstract class ProviderApiBase extends IntentService {
return CA_CERT_DOWNLOADED;
}
+ protected boolean isValidJson(String jsonString) {
+ try {
+ new JSONObject(jsonString);
+ return true;
+ } catch(JSONException e) {
+ return false;
+ } catch(NullPointerException e) {
+ return false;
+ }
+ }
+
protected boolean validCertificate(String cert_string) {
boolean result = false;
if (!ConfigHelper.checkErroneousDownload(cert_string)) {