diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index f54467e5..0168e559 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -142,10 +142,10 @@ Module.register("weatherforecast",{ var maxTempCell = document.createElement("td"); maxTempCell.innerHTML = forecast.maxTemp; - if(this.config.scale.toUpperCase() == "C") { + if(typeof(this.config.scale) == "string" && this.config.scale.toUpperCase() == "C") { maxTempCell.innerHTML += " °C"; } else { - if(this.config.scale.toUpperCase() == "F") { + if(typeof(this.config.scale) == "string" && this.config.scale.toUpperCase() == "F") { maxTempCell.innerHTML += " °F"; } } @@ -154,10 +154,10 @@ Module.register("weatherforecast",{ var minTempCell = document.createElement("td"); minTempCell.innerHTML = forecast.minTemp; - if(this.config.scale.toUpperCase() == "C") { + if(typeof(this.config.scale) == "string" && this.config.scale.toUpperCase() == "C") { minTempCell.innerHTML += " °C"; } else { - if(this.config.scale.toUpperCase() == "F") { + if(typeof(this.config.scale) == "string" && this.config.scale.toUpperCase() == "F") { minTempCell.innerHTML += " °F"; } }