summaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
Diffstat (limited to 'app/src')
-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());