Add extra check for currentweather

This commit is contained in:
veeck 2021-01-17 15:00:34 +01:00
parent 3895c18466
commit 90f07295b1

View File

@ -154,7 +154,10 @@ Module.register("weather", {
Log.log("New weather information available.");
this.updateDom(0);
this.scheduleUpdate();
this.sendNotification("CURRENTWEATHER_TYPE", { type: this.weatherProvider.currentWeather().weatherType.replace("-", "_") });
if (this.weatherProvider.currentWeather()) {
this.sendNotification("CURRENTWEATHER_TYPE", { type: this.weatherProvider.currentWeather().weatherType.replace("-", "_") });
}
},
scheduleUpdate: function (delay = null) {