[gnome-shell] dateMenu: Fix possible crash with unknown locations



commit 29987ae033645cbfc3d8cb2a68e2170af6ec0e10
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Dec 4 14:30:01 2017 +0100

    dateMenu: Fix possible crash with unknown locations
    
    If there are locations unknown to the libgweather version gnome-shell is
    using, don't crash.
    
    JS ERROR: TypeError: b.location is null
    WorldClocksSection<._clocksChanged/<@resource:///org/gnome/shell/ui/dateMenu.js:141:1
    WorldClocksSection<._clocksChanged@resource:///org/gnome/shell/ui/dateMenu.js:139:9
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791148

 js/ui/dateMenu.js |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js
index 5908c90..e732e0b 100644
--- a/js/ui/dateMenu.js
+++ b/js/ui/dateMenu.js
@@ -135,7 +135,8 @@ var WorldClocksSection = new Lang.Class({
             if (!clocks[i].location)
                 continue;
             let l = world.deserialize(clocks[i].location);
-            this._locations.push({ location: l });
+            if (l)
+                this._locations.push({ location: l });
         }
 
         this._locations.sort(function(a, b) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]