Skip to content

Commit

Permalink
Prevent crash when macro contains invalid action or condition
Browse files Browse the repository at this point in the history
  • Loading branch information
WarmUpTill committed Jan 29, 2025
1 parent 6a58684 commit e140832
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/macro/macro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -383,6 +387,9 @@ bool Macro::RunActionsHelper(

bool actionsExecutedSuccessfully = true;
for (auto &action : actions) {
if (!action) {
continue;
}
if (action->Enabled()) {
action->LogAction();
actionsExecutedSuccessfully =
Expand Down

0 comments on commit e140832

Please sign in to comment.