From 125bf2375e5de8ecaaf3183c4acdd595c9f81204 Mon Sep 17 00:00:00 2001 From: PauloftheWest Date: Tue, 2 Sep 2014 06:48:03 -0700 Subject: [PATCH] Fixed a Null Pointer Exception when Wifi Settings is indexing. Bug: 17335468 Change-Id: I85293e882d90da4a54d4690ffec32fba7101b65e --- src/com/android/settings/wifi/AccessPoint.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/com/android/settings/wifi/AccessPoint.java b/src/com/android/settings/wifi/AccessPoint.java index 0321e7f8187..ac818a7b0e1 100644 --- a/src/com/android/settings/wifi/AccessPoint.java +++ b/src/com/android/settings/wifi/AccessPoint.java @@ -271,9 +271,13 @@ class AccessPoint extends Preference { // set the icon (drawable) to that state's drawable. StateListDrawable sld = (StateListDrawable) context.getTheme() .obtainStyledAttributes(wifi_signal_attributes).getDrawable(0); - sld.setState((security != SECURITY_NONE) ? STATE_SECURED : STATE_NONE); - drawable = sld.getCurrent(); - setIcon(drawable); + // If sld is null then we are indexing and therefore do not have access to + // (nor need to display) the drawable. + if (sld != null) { + sld.setState((security != SECURITY_NONE) ? STATE_SECURED : STATE_NONE); + drawable = sld.getCurrent(); + setIcon(drawable); + } } if (drawable != null) {