From 2c5121ee94b0ddb4555a8acaf55f880e1abdd89e Mon Sep 17 00:00:00 2001 From: WarmUpTill <19472752+WarmUpTill@users.noreply.github.com> Date: Wed, 29 Jan 2025 19:07:18 +0100 Subject: [PATCH] Prevent crash when macro contains invalid action or condition --- lib/macro/macro.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/macro/macro.cpp b/lib/macro/macro.cpp index 9209449d..2e1ac629 100644 --- a/lib/macro/macro.cpp +++ b/lib/macro/macro.cpp @@ -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 =