Don't create AP items for empty networks

Current code is sometime attempting to create menu items for wifi
networks that have no visible AP. I have no idea why this is
happening, but it should fix the symptoms and avoid exceptions.

https://bugzilla.gnome.org/show_bug.cgi?id=658150
This commit is contained in:
Giovanni Campagna 2011-09-18 13:25:45 +01:00 committed by Adel Gadllah
parent ce2dc84e49
commit 05e0d5066f

View File

@ -1480,6 +1480,11 @@ NMDeviceWireless.prototype = {
},
_createNetworkItem: function(apObj, position) {
if(!apObj.accessPoints || apObj.accessPoints.length == 0) {
// this should not happen, but I have no idea why it happens
return;
}
if(apObj.connections.length > 0) {
if (apObj.connections.length == 1)
apObj.item = this._createAPItem(apObj.connections[0], apObj, false);