Check if objectId exists in childrednmap first; this will prevent a hardfault

This commit is contained in:
spahr@ksat-stuttgart.de 2025-04-02 22:18:31 +02:00
parent b665b2effe
commit 95520d7d0c

View File

@ -264,7 +264,15 @@ void AssemblyBase::overwriteDeviceHealth(object_id_t objectId, HasHealthIF::Heal
triggerEvent(OVERWRITING_HEALTH, objectId, oldHealth);
internalState = STATE_OVERWRITE_HEALTH;
modeHelper.setForced(true);
sendHealthCommand(childrenMap[objectId].commandQueue, EXTERNAL_CONTROL);
if(childrenMap.find(objectId) != childrenMap.end()) {
sendHealthCommand(childrenMap.at(objectId).commandQueue, EXTERNAL_CONTROL);
} else {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::debug << std::hex << SystemObject::getObjectId() << ": invalid mode table entry"
<< std::endl;
#endif
}
}
void AssemblyBase::triggerModeHelperEvents(Mode_t mode, Submode_t submode) {