1
0
Fork 0

weather: Fix crash when weather.json is absent

master
Ben Whittaker 2021-10-04 09:23:12 -04:00
parent a2c400780d
commit 46ccfe86e3
3 changed files with 4 additions and 3 deletions

View File

@ -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",

View File

@ -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.

View File

@ -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')||{});