fix NPE crash if VPN prepare Intent is null on boot

This commit is contained in:
Nathan Freitas 2015-04-13 10:24:03 -04:00
parent ddecd0ce82
commit ec24428915
1 changed files with 8 additions and 8 deletions

View File

@ -35,9 +35,9 @@ public class OnBootReceiver extends BroadcastReceiver {
public void startVpnService (Context context) public void startVpnService (Context context)
{ {
Intent intent = VpnService.prepare(context); Intent intent = VpnService.prepare(context);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (intent != null) { if (intent != null) {
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent); context.startActivity(intent);
} }