[gnome-shell] Don't create AP items for empty networks
- From: Adel Gadllah <agadllah src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gnome-shell] Don't create AP items for empty networks
 
- Date: Tue, 20 Sep 2011 17:01:47 +0000 (UTC)
 
commit 05e0d5066f5f12947ad3f46473bcbbad053dab6a
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sun Sep 18 13:25:45 2011 +0100
    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 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 0dc7ee2..0d5eaad 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);
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]