From e33d221e5ee959c9df4752ac0559b19fe15fc78e Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 18 Apr 2016 07:28:35 +0200 Subject: [PATCH] Prevent crash --- app/src/main/java/eu/faircode/netguard/Receiver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/netguard/Receiver.java b/app/src/main/java/eu/faircode/netguard/Receiver.java index cd03b277..5ce891bb 100644 --- a/app/src/main/java/eu/faircode/netguard/Receiver.java +++ b/app/src/main/java/eu/faircode/netguard/Receiver.java @@ -119,7 +119,7 @@ public class Receiver extends BroadcastReceiver { // Get application info PackageManager pm = context.getPackageManager(); String[] packages = pm.getPackagesForUid(uid); - if (packages.length < 1) + if (packages == null || packages.length < 1) throw new PackageManager.NameNotFoundException(Integer.toString(uid)); boolean internet = Util.hasInternet(uid, context);