mirror of https://github.com/espruino/BangleApps
Merge pull request #839 from nebbishhacker/weatherrefactor
weather: Fix crash when weather.json is absentpull/840/head
commit
ba08863b14
|
@ -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",
|
||||
|
|
|
@ -5,3 +5,4 @@
|
|||
0.06: Use setUI for launcher.
|
||||
0.07: Add theme support and unknown icon.
|
||||
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