better error handlig of shared data

This commit is contained in:
Matt Walsh 2022-12-08 14:41:15 -06:00
commit d0382e0de1
3 changed files with 10 additions and 3 deletions

View file

@ -28,6 +28,10 @@ class HourlyGraph extends WeatherDisplay {
if (!super.getData()) return;
const data = await getHourlyData();
if (data === undefined) {
this.setStatus(STATUS.failed);
return;
}
// get interesting data
const temperature = data.map((d) => d.temperature);