fix NPE crash if VPN prepare Intent is null on boot
This commit is contained in:
parent
ddecd0ce82
commit
ec24428915
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue