adding guard for send command

This commit is contained in:
ponsin_h committed 2026-08-20 09:23:24 +02:00
1 parent 579e7b8e84
commit c613e83420
2 files changed
+6 -2

No files matched your search

-2
View File
@@ -82,8 +82,6 @@ target_include_directories(
${EPICSSYS}/include/compiler/clang
)
################################################################################
## Frontend
################################################################################
+6
View File
@@ -118,6 +118,12 @@ void powerSwitch::updateOutletNumber() {
}
void powerSwitch::sendCommand(int index) {
if (index < 0 || index >= (int)outlets.size()) {
fMfe->Msg(MERROR, __FUNCTION__,
"Command received for outlet %d but only %d outlet(s) ready",
index, (int)outlets.size());
return;
}
midas::odb o(this->equipmentPath);
std::string command = o[COMMAND_PATH.c_str()][index];
Outlet *outlet = &outlets.at(index);