android: Catch NullPointerException when calling VpnService.prepare()

According to the Play Console this occurs occasionally.
This commit is contained in:
Tobias Brunner
2017-09-04 10:41:24 +02:00
parent d43b84dcb4
commit e59b78254a
@@ -218,6 +218,12 @@ public class MainActivity extends AppCompatActivity implements OnVpnProfileSelec
VpnNotSupportedError.showWithMessage(this, R.string.vpn_not_supported_during_lockdown);
return;
}
catch (NullPointerException ex)
{
/* not sure when this happens exactly, but apparently it does */
VpnNotSupportedError.showWithMessage(this, R.string.vpn_not_supported);
return;
}
/* store profile info until the user grants us permission */
mProfileInfo = profileInfo;
if (intent != null)