From 94a9f0a4ab87baaca1ed1078be27a8c9fdb40d87 Mon Sep 17 00:00:00 2001 From: Irfan Sheriff Date: Wed, 6 Jan 2010 16:23:26 -0800 Subject: [PATCH] Do a null check on setting an AP as configured This was introduced when trying to fix bug 2296038. A null check is required on AP. Bug: 2296038 --- src/com/android/settings/wifi/AccessPointDialog.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/wifi/AccessPointDialog.java b/src/com/android/settings/wifi/AccessPointDialog.java index 69fad0fa4d7..bf9a47145a2 100644 --- a/src/com/android/settings/wifi/AccessPointDialog.java +++ b/src/com/android/settings/wifi/AccessPointDialog.java @@ -632,8 +632,14 @@ public class AccessPointDialog extends AlertDialog implements DialogInterface.On updateEnterpriseFields(); } - /* AP state on the current scan list needs update to enable "Forget" capability */ - mWifiLayer.getWifiLayerApInstance(mState).setConfigured(true); + /** + * AP state on the current scan list needs update to enable "Forget" capability. + * This is not required for newly added APs. + */ + AccessPointState ap = mWifiLayer.getWifiLayerApInstance(mState); + if(ap != null) { + ap.setConfigured(true); + } if (!mWifiLayer.saveNetwork(mState)) { return;