weatherClock bug fix

Check to make sure weather.json file was not an empty object.
master
James G 2021-12-05 18:54:04 -05:00
parent 53f28a7647
commit bf4498e5b8
1 changed files with 1 additions and 1 deletions

View File

@ -105,7 +105,7 @@ function draw() {
clockLayout.date.label = locale.date(date, 1).toUpperCase();
clockLayout.dow.label = locale.dow(date, 1).toUpperCase();
var weatherJson = getWeather();
if(weatherJson){
if(weatherJson && weatherJson.weather){
var currentWeather = weatherJson.weather;
const temp = locale.temp(currentWeather.temp-273.15).match(/^(\D*\d*)(.*)$/);
clockLayout.temp.label = temp[1];