in a fixed size array with an unitialized union type a uint64_t value can have a default value

This commit is contained in:
Marcel Alburg 2022-08-16 22:33:19 +02:00
parent 04db808920
commit 9073d2a82c
2 changed files with 4 additions and 1 deletions

View file

@ -91,7 +91,7 @@ class HmSystem {
INVERTERTYPE *getInverterByPos(uint8_t pos, bool check = true) {
DPRINTLN(DBG_VERBOSE, F("hmSystem.h:getInverterByPos"));
if((mInverter[pos].serial.u64 != 0ULL) || false == check)
if((mInverter[pos].initialized && mInverter[pos].serial.u64 != 0ULL) || false == check)
return &mInverter[pos];
else
return NULL;