From c46316ffd330a903c70734dc7922410951a0f7a8 Mon Sep 17 00:00:00 2001 From: Glen Kuhne Date: Mon, 3 Apr 2017 09:24:33 -0700 Subject: Fix null exception error Added a missing null check that was causing rare framework reset bug. Bug: 36625896 Test: Existing Unit tests Change-Id: I3aac9b8e629bbe288d191aef783651837f36095e --- service/java/com/android/server/wifi/WifiStateMachine.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index 6e5da1716..1fe895ea5 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -5804,7 +5804,9 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss // If this network was explicitly selected by the user, evaluate whether to call // explicitlySelected() so the system can treat it appropriately. WifiConfiguration config = getCurrentWifiConfiguration(); - if (mWifiConfigManager.getLastSelectedNetwork() == config.networkId) { + if (config == null) { + Log.wtf(TAG, "Current WifiConfiguration is null, but IP provisioning just succeeded"); + } else if (mWifiConfigManager.getLastSelectedNetwork() == config.networkId) { boolean prompt = mWifiPermissionsUtil.checkConfigOverridePermission(config.lastConnectUid); if (mVerboseLoggingEnabled) { -- cgit v1.2.3