From 688e61a4c6cc0502b774c571f3f25884f1f65892 Mon Sep 17 00:00:00 2001 From: xuelin Date: Thu, 8 Dec 2022 09:49:35 +0800 Subject: [PATCH] fix WifiUtils:isNetworkLockedDown() null pointer issue In the WifiUtils class, the isNetworkLockedDown() method does not determine whether the context is empty, which will cause a null pointer exception. This change adds a condition for judging the input context as empty. Bug:261812909 Test:make RunSettingsRoboTests Change-Id: Ie0f17179c25a7e9d4b2f652a5667eef3cc577c7b Signed-off-by: xuelin --- src/com/android/settings/wifi/WifiUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/wifi/WifiUtils.java b/src/com/android/settings/wifi/WifiUtils.java index 4b94c81fda0..4a3616a28e0 100644 --- a/src/com/android/settings/wifi/WifiUtils.java +++ b/src/com/android/settings/wifi/WifiUtils.java @@ -86,7 +86,7 @@ public class WifiUtils extends com.android.settingslib.wifi.WifiUtils { * @return true if Settings cannot modify the config due to lockDown. */ public static boolean isNetworkLockedDown(Context context, WifiConfiguration config) { - if (config == null) { + if (context == null || config == null) { return false; }