From a3736d3a3951af8d5f67c3d0a961e5df9be7825f Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 4 Dec 2017 14:30:01 +0100 Subject: [PATCH] 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 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js index 5908c904f..e732e0b1c 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) {