dateMenu: Ignore malformed world-clocks settings

Guard against a malformed setting that doesn't contain a
'location' key.

https://bugzilla.gnome.org/show_bug.cgi?id=791148
This commit is contained in:
Bastien Nocera 2017-12-04 14:30:01 +01:00
parent 74683b7ef7
commit a29ceb31dd

View File

@ -132,6 +132,8 @@ var WorldClocksSection = new Lang.Class({
let world = GWeather.Location.get_world();
let clocks = settings.get_value('world-clocks').deep_unpack();
for (let i = 0; i < clocks.length; i++) {
if (!clocks[i].location)
continue;
let l = world.deserialize(clocks[i].location);
this._locations.push({ location: l });
}