[gnome-shell/gnome-3-26] dateMenu: Fix possible crash with unknown locations
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-26] dateMenu: Fix possible crash with unknown locations
- Date: Wed, 6 Dec 2017 01:07:13 +0000 (UTC)
commit a3736d3a3951af8d5f67c3d0a961e5df9be7825f
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]