From ec537bea685ad012d36b354552ec3b1f7ba62645 Mon Sep 17 00:00:00 2001 From: xshu Date: Fri, 29 May 2020 13:43:38 -0700 Subject: NPE in WifiNetworkSelector Bug: 157680802 Test: atest com.android.server.wifi Change-Id: I1b667a7fc1c7d37aac782fcefb6bc157df811e68 --- service/java/com/android/server/wifi/WifiNetworkSelector.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service/java/com/android/server/wifi/WifiNetworkSelector.java b/service/java/com/android/server/wifi/WifiNetworkSelector.java index 7e95fba0b..f59a50fc2 100644 --- a/service/java/com/android/server/wifi/WifiNetworkSelector.java +++ b/service/java/com/android/server/wifi/WifiNetworkSelector.java @@ -940,6 +940,9 @@ public class WifiNetworkSelector { } WifiConfiguration config = mWifiConfigManager.getConfiguredNetwork(choice.candidateKey.networkId); + if (config == null) { + return; + } if (config.isPasspoint()) { config.SSID = choice.candidateKey.matchInfo.networkSsid; mWifiConfigManager.addOrUpdateNetwork(config, config.creatorUid, config.creatorName); -- cgit v1.2.3