From 8ad913a88fc22325a19eb5b16e385a3c04827fc5 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 16 Apr 2013 20:22:59 +0200 Subject: Fix NPE when calling disconnect() without being connected --- src/de/blinkt/openvpn/api/ExternalOpenVPNService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java b/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java index 2eee8d82..21580eb4 100644 --- a/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java +++ b/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java @@ -210,8 +210,8 @@ public class ExternalOpenVPNService extends Service implements StateListener { @Override public void disconnect() throws RemoteException { checkOpenVPNPermission(); - - mService.getManagement().stopVPN(); + if(mService!=null && mService.getManagement()!=null) + mService.getManagement().stopVPN(); } }; -- cgit v1.2.3