commit ec2442891590366b2c8a625551a92e74e9947393 Author: Nathan Freitas nathan@freitas.net Date: Mon Apr 13 10:24:03 2015 -0400
fix NPE crash if VPN prepare Intent is null on boot --- src/org/torproject/android/service/OnBootReceiver.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/org/torproject/android/service/OnBootReceiver.java b/src/org/torproject/android/service/OnBootReceiver.java index f87d2bb..a97091e 100644 --- a/src/org/torproject/android/service/OnBootReceiver.java +++ b/src/org/torproject/android/service/OnBootReceiver.java @@ -33,15 +33,15 @@ public class OnBootReceiver extends BroadcastReceiver { @SuppressLint("NewApi") public void startVpnService (Context context) - { - Intent intent = VpnService.prepare(context); - intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - - if (intent != null) { - context.startActivity(intent); - } + { + Intent intent = VpnService.prepare(context); + + if (intent != null) { + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(intent); + }
- } + }
private void startService (String action, Context context) {
tor-commits@lists.torproject.org