weatherClock bug fix
Check to make sure weather.json file was not an empty object.master
parent
53f28a7647
commit
bf4498e5b8
|
|
@ -105,7 +105,7 @@ function draw() {
|
||||||
clockLayout.date.label = locale.date(date, 1).toUpperCase();
|
clockLayout.date.label = locale.date(date, 1).toUpperCase();
|
||||||
clockLayout.dow.label = locale.dow(date, 1).toUpperCase();
|
clockLayout.dow.label = locale.dow(date, 1).toUpperCase();
|
||||||
var weatherJson = getWeather();
|
var weatherJson = getWeather();
|
||||||
if(weatherJson){
|
if(weatherJson && weatherJson.weather){
|
||||||
var currentWeather = weatherJson.weather;
|
var currentWeather = weatherJson.weather;
|
||||||
const temp = locale.temp(currentWeather.temp-273.15).match(/^(\D*\d*)(.*)$/);
|
const temp = locale.temp(currentWeather.temp-273.15).match(/^(\D*\d*)(.*)$/);
|
||||||
clockLayout.temp.label = temp[1];
|
clockLayout.temp.label = temp[1];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue