1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2024-12-24 08:45:53 +00:00

Check VpnService.Builder.establish result

This commit is contained in:
M66B 2015-11-18 15:25:32 +01:00
parent 2dd8b060b2
commit caaf936bcb

View file

@ -109,12 +109,8 @@ public class SinkholeService extends VpnService {
vpn = startVPN();
startDebug(vpn);
}
if (vpn == null)
prefs.edit().putBoolean("enabled", false).apply();
else {
removeDisabledNotification();
Widget.updateWidgets(SinkholeService.this);
}
break;
case reload:
@ -193,7 +189,10 @@ public class SinkholeService extends VpnService {
// Start VPN service
try {
return builder.establish();
ParcelFileDescriptor result = builder.establish();
if (result == null)
throw new IllegalStateException("VpnService.Builder.establish returned unexpectedly NULL");
return result;
} catch (Throwable ex) {
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));