summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-12-05 07:37:33 +0100
committerArne Schwabe <arne@rfc2549.org>2013-12-05 07:37:33 +0100
commit45f46afdd384435545040f5ee851122d2a040dac (patch)
tree960ab1b496a3ba97e70206e829dc4a1b15dd2fa7 /src
parent0c5b8e5ba93c3154971f97c7924e3409df4c98ed (diff)
Fix NPE in DeviceStateReceiverv0.6.1
Diffstat (limited to 'src')
-rw-r--r--src/de/blinkt/openvpn/core/OpenVpnService.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/de/blinkt/openvpn/core/OpenVpnService.java b/src/de/blinkt/openvpn/core/OpenVpnService.java
index 3a6cc802..c0b24c3a 100644
--- a/src/de/blinkt/openvpn/core/OpenVpnService.java
+++ b/src/de/blinkt/openvpn/core/OpenVpnService.java
@@ -328,6 +328,12 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
// An old running VPN should now be exited
mStarting = false;
+ // Start a new session by creating a new thread.
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
+
+ mOvpn3 = prefs.getBoolean("ovpn3", false);
+ mOvpn3 = false;
+
// Open the Management Interface
if (!mOvpn3) {
@@ -340,14 +346,12 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
mSocketManagerThread.start();
mManagement = ovpnManagementThread;
VpnStatus.logInfo("started Socket Thread");
+ } else {
+ return START_NOT_STICKY;
}
}
- // Start a new session by creating a new thread.
- SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
- mOvpn3 = prefs.getBoolean("ovpn3", false);
- mOvpn3 = false;
Runnable processThread;
if (mOvpn3) {