From 05e0d5066f5f12947ad3f46473bcbbad053dab6a Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Sun, 18 Sep 2011 13:25:45 +0100 Subject: [PATCH] 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 --- js/ui/status/network.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 0dc7ee25e..0d5eaad06 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -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);