summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2019-06-12 17:42:32 +0200
committercyBerta <cyberta@riseup.net>2019-08-02 01:49:37 +0200
commit386c580a9a97870f500bf277a1d1ec25a8f4a056 (patch)
tree8d80dc275f6adf8e34ca00bc5129c04f58b2df9e
parent04df0d72d5f085a60e3b75b1b7df6244f04940f0 (diff)
add null checks for the case shapeshifter-dispatcher is not running
-rw-r--r--app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
index 55a92cb0..b775921c 100644
--- a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
+++ b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
@@ -248,7 +248,7 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac
if(isVpnRunning()) {
if (getManagement() != null && getManagement().stopVPN(replaceConnection)) {
if (!replaceConnection) {
- if (dispatcher.isRunning()) {
+ if (dispatcher != null && dispatcher.isRunning()) {
dispatcher.stop();
}
VpnStatus.updateStateString("NOPROCESS", "VPN STOPPED", R.string.state_noprocess, ConnectionStatus.LEVEL_NOTCONNECTED);
@@ -258,7 +258,7 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac
return false;
} else {
if (!replaceConnection) {
- if (dispatcher.isRunning()) {
+ if (dispatcher != null && dispatcher.isRunning()) {
dispatcher.stop();
}
VpnStatus.updateStateString("NOPROCESS", "VPN STOPPED", R.string.state_noprocess, ConnectionStatus.LEVEL_NOTCONNECTED);
@@ -395,7 +395,7 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac
obfs4Connection.getmObfs4IatMode());
dispatcher.initSync();
- if (dispatcher.getPort() != null && dispatcher.getPort().length() > 0) {
+ if (dispatcher.isRunning()) {
connection.setServerPort(dispatcher.getPort());
Log.d(TAG, "Dispatcher running. Profile server name and port: " +
connection.getServerName() + ":" + connection.getServerPort());