diff options
author | Arne Schwabe <arne@rfc2549.org> | 2023-09-05 00:36:20 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2023-10-10 11:41:01 +0200 |
commit | 83e20b974f916710255c9211dc3dd77595c0aebf (patch) | |
tree | 15b4412b400c83c1c0c8a97d962a8fe99e7fe6db /main | |
parent | 2c66e7086c50d78caadc080313d3d6e4605de95e (diff) |
Throw expection if profile is not found
Diffstat (limited to 'main')
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/api/ExternalOpenVPNService.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/api/ExternalOpenVPNService.java b/main/src/main/java/de/blinkt/openvpn/api/ExternalOpenVPNService.java index c6a4339a..ab71f00b 100644 --- a/main/src/main/java/de/blinkt/openvpn/api/ExternalOpenVPNService.java +++ b/main/src/main/java/de/blinkt/openvpn/api/ExternalOpenVPNService.java @@ -239,6 +239,8 @@ public class ExternalOpenVPNService extends Service implements StateListener { mExtAppDb.checkOpenVPNPermission(getPackageManager());
ProfileManager pm = ProfileManager.getInstance(getBaseContext());
VpnProfile vp = ProfileManager.get(getBaseContext(), profileUUID);
+ if (vp == null)
+ throw new RemoteException("Profile not found");
pm.removeProfile(ExternalOpenVPNService.this, vp);
}
@@ -246,7 +248,7 @@ public class ExternalOpenVPNService extends Service implements StateListener { public boolean protectSocket(ParcelFileDescriptor pfd) throws RemoteException {
mExtAppDb.checkOpenVPNPermission(getPackageManager());
try {
- boolean success= mService.protect(pfd.getFd());
+ boolean success = mService.protect(pfd.getFd());
pfd.close();
return success;
} catch (IOException e) {
|