From 437173854f073c4b07b75f0bacae19e6d458115c Mon Sep 17 00:00:00 2001 From: lumapu Date: Sat, 18 May 2024 14:04:17 +0200 Subject: [PATCH] 0.8.120 * fix crash if invalid serial number was set --- src/CHANGES.md | 3 +++ src/defines.h | 2 +- src/hm/hmSystem.h | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/CHANGES.md b/src/CHANGES.md index 1cef0a8a..8bdd6c40 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -1,5 +1,8 @@ # Development Changes +## 0.8.120 - 2024-05-18 +* fix crash if invalid serial number was set + ## 0.8.119 - 2024-05-17 * fix reset values at midnight if WiFi isn't available #1620 * fix typo in English versions diff --git a/src/defines.h b/src/defines.h index 3e7adc01..7a91ac1d 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 119 +#define VERSION_PATCH 120 //------------------------------------- typedef struct { uint8_t ch; diff --git a/src/hm/hmSystem.h b/src/hm/hmSystem.h index 0e86881d..e6274696 100644 --- a/src/hm/hmSystem.h +++ b/src/hm/hmSystem.h @@ -74,6 +74,7 @@ class HmSystem { iv->ivRadioType = INV_RADIO_TYPE_CMT; } else if(iv->config->serial.u64 != 0ULL) { DPRINTLN(DBG_ERROR, F("inverter type can't be detected!")); + iv->config = nullptr; return; } else iv->ivGen = IV_UNKNOWN; @@ -116,6 +117,8 @@ class HmSystem { DPRINTLN(DBG_VERBOSE, F("hmSystem.h:getInverterByPos")); if(pos >= MAX_INVERTER) return nullptr; + else if(nullptr == mInverter[pos].config) + return nullptr; else if((mInverter[pos].config->serial.u64 != 0ULL) || (false == check)) return &mInverter[pos]; else