diff --git a/CHANGELOG.md b/CHANGELOG.md index a18ea640..e1ba380c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Fixes +- Only delete health table entry in `HealthHelper` destructor if + health table was set. + PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/710/files - I2C Bugfixes: Do not keep iterator as member and fix some incorrect handling with the iterator. Also properly reset the reply size for successfull transfers and erroneous transfers. PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/700 diff --git a/src/fsfw/health/HealthHelper.cpp b/src/fsfw/health/HealthHelper.cpp index bf1a92d2..f6077ea1 100644 --- a/src/fsfw/health/HealthHelper.cpp +++ b/src/fsfw/health/HealthHelper.cpp @@ -5,7 +5,11 @@ HealthHelper::HealthHelper(HasHealthIF* owner, object_id_t objectId) : objectId(objectId), owner(owner) {} -HealthHelper::~HealthHelper() { healthTable->removeObject(objectId); } +HealthHelper::~HealthHelper() { + if (healthTable != nullptr) { + healthTable->removeObject(objectId); + } +} ReturnValue_t HealthHelper::handleHealthCommand(CommandMessage* message) { switch (message->getCommand()) {