forked from FOSS/BangleApps
weather: Fix crash when weather.json is absent
parent
a2c400780d
commit
46ccfe86e3
|
@ -585,7 +585,7 @@
|
|||
{ "id": "weather",
|
||||
"name": "Weather",
|
||||
"icon": "icon.png",
|
||||
"version":"0.08",
|
||||
"version":"0.09",
|
||||
"description": "Show Gadgetbridge weather report",
|
||||
"readme": "readme.md",
|
||||
"tags": "widget,outdoors",
|
||||
|
|
|
@ -4,4 +4,5 @@
|
|||
0.05: Add wind direction.
|
||||
0.06: Use setUI for launcher.
|
||||
0.07: Add theme support and unknown icon.
|
||||
0.08: Refactor and reduce widget ram usage.
|
||||
0.08: Refactor and reduce widget ram usage.
|
||||
0.09: Fix crash when weather.json is absent.
|
|
@ -47,7 +47,7 @@ global.GB = (event) => {
|
|||
};
|
||||
|
||||
exports.get = function() {
|
||||
return storage.readJSON('weather.json').weather;
|
||||
return (storage.readJSON('weather.json')||{}).weather;
|
||||
}
|
||||
|
||||
scheduleExpiry(storage.readJSON('weather.json')||{});
|
||||
|
|
Loading…
Reference in New Issue