Merge "Fixed a Null Pointer Exception when Wifi Settings is indexing." into lmp-dev
diff --git a/src/com/android/settings/wifi/AccessPoint.java b/src/com/android/settings/wifi/AccessPoint.java
index 0321e7f..ac818a7 100644
--- a/src/com/android/settings/wifi/AccessPoint.java
+++ b/src/com/android/settings/wifi/AccessPoint.java
@@ -271,9 +271,13 @@
// 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) {