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
This commit is contained in:
Irfan Sheriff
2010-01-06 16:23:26 -08:00
parent eea480c796
commit 94a9f0a4ab

View File

@@ -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;