fixes crash when dayahead data is unavailable

This commit is contained in:
Nic Limper
2025-04-05 14:00:05 +02:00
parent c621050f18
commit e8eb87e7c1

View File

@@ -1613,6 +1613,10 @@ bool getDayAheadFeed(String &filename, JsonObject &cfgobj, tagRecord *&taginfo,
initSprite(spr, imageParams.width, imageParams.height, imageParams);
int n = doc.size();
if (n == 0) {
wsErr("No data in dayahead feed");
return false;
}
int units = cfgobj["units"].as<int>();
if (units == 0) units = 1;