Prevent currentweather module from crashing.

This commit is contained in:
Michael Teeuw
2016-07-31 17:13:49 +02:00
parent 89917c1582
commit 3d3c4ba02f
2 changed files with 8 additions and 0 deletions

View File

@@ -217,6 +217,13 @@ Module.register("currentweather",{
* argument data object - Weather information received form openweather.org.
*/
processWeather: function(data) {
if (!data || !data.main || !data.main.temp) {
// Did not receive usable new data.
// Maybe this needs a better check?
return;
}
this.temperature = this.roundValue(data.main.temp);
if (this.config.useBeaufort){