From 454e755d71b7c7a3f62bc1f6ab76b860fa4dfb3d Mon Sep 17 00:00:00 2001 From: cyBerta Date: Sun, 6 Oct 2019 00:18:20 +0200 Subject: show error dialog if no valid gateway configuration can be found for a provider --- app/src/main/java/se/leap/bitmaskclient/eip/EIP.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/src/main/java/se/leap/bitmaskclient') diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java index 19c539e8..474e639e 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java @@ -77,6 +77,7 @@ import static se.leap.bitmaskclient.Constants.PROVIDER_VPN_CERTIFICATE; import static se.leap.bitmaskclient.Constants.SHARED_PREFERENCES; import static se.leap.bitmaskclient.MainActivityErrorDialog.DOWNLOAD_ERRORS.ERROR_INVALID_VPN_CERTIFICATE; import static se.leap.bitmaskclient.R.string.vpn_certificate_is_invalid; +import static se.leap.bitmaskclient.R.string.warning_client_parsing_error_gateways; import static se.leap.bitmaskclient.utils.ConfigHelper.ensureNotOnMainThread; import static se.leap.bitmaskclient.utils.PreferenceHelper.getUsePluggableTransports; @@ -206,6 +207,12 @@ public final class EIP extends JobIntentService implements Observer { } GatewaysManager gatewaysManager = gatewaysFromPreferences(); + if (gatewaysManager.isEmpty()) { + setErrorResult(result, warning_client_parsing_error_gateways, null); + tellToReceiverOrBroadcast(EIP_ACTION_START, RESULT_CANCELED, result); + return; + } + Gateway gateway = gatewaysManager.select(nClosestGateway); if (launchActiveGateway(gateway, nClosestGateway)) { @@ -377,7 +384,6 @@ public final class EIP extends JobIntentService implements Observer { result.putBoolean(BROADCAST_RESULT_KEY, false); } - /** * disable Bitmask starting on after phone reboot * then stop VPN -- cgit v1.2.3