Check if objectId exists in childrednmap first; this will prevent a hardfault
This commit is contained in:
parent
b665b2effe
commit
95520d7d0c
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user