Fixed a Null Pointer Exception when Wifi Settings is indexing.

Bug: 17335468
Change-Id: I85293e882d90da4a54d4690ffec32fba7101b65e
This commit is contained in:
PauloftheWest
2014-09-02 06:48:03 -07:00
parent 48d3f0fd61
commit 125bf2375e

View File

@@ -271,9 +271,13 @@ class AccessPoint extends Preference {
// set the icon (drawable) to that state's drawable. // set the icon (drawable) to that state's drawable.
StateListDrawable sld = (StateListDrawable) context.getTheme() StateListDrawable sld = (StateListDrawable) context.getTheme()
.obtainStyledAttributes(wifi_signal_attributes).getDrawable(0); .obtainStyledAttributes(wifi_signal_attributes).getDrawable(0);
sld.setState((security != SECURITY_NONE) ? STATE_SECURED : STATE_NONE); // If sld is null then we are indexing and therefore do not have access to
drawable = sld.getCurrent(); // (nor need to display) the drawable.
setIcon(drawable); if (sld != null) {
sld.setState((security != SECURITY_NONE) ? STATE_SECURED : STATE_NONE);
drawable = sld.getCurrent();
setIcon(drawable);
}
} }
if (drawable != null) { if (drawable != null) {