Prevent crash when macro contains invalid action or condition

This commit is contained in:
WarmUpTill 2025-01-29 19:07:18 +01:00 committed by WarmUpTill
parent 6a58684854
commit 2c5121ee94

View File

@ -246,6 +246,10 @@ bool Macro::CheckConditions(bool ignorePause)
_matched = false;
for (auto &condition : _conditions) {
if (!condition) {
continue;
}
if (_paused && !ignorePause) {
vblog(LOG_INFO, "Macro %s is paused", _name.c_str());
return false;
@ -383,6 +387,9 @@ bool Macro::RunActionsHelper(
bool actionsExecutedSuccessfully = true;
for (auto &action : actions) {
if (!action) {
continue;
}
if (action->Enabled()) {
action->LogAction();
actionsExecutedSuccessfully =