From 494d206dc74cea0ab0b8f4f045c61c82f5f1e0d9 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Tue, 23 Feb 2021 11:39:00 +0100 Subject: [PATCH] A non existing enabler can't be removed. Don't show message the "Purged all action enablers for" message when the action didn't have any enablers to purge. See osdn #41641 --- server/ruleset.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/ruleset.c b/server/ruleset.c index 12e93cc30e..d9836d1cfc 100644 --- a/server/ruleset.c +++ b/server/ruleset.c @@ -229,6 +229,12 @@ static int ruleset_purge_unused_enablers(void) action_iterate(act_id) { struct action *paction = action_by_number(act_id); + if (action_enabler_list_size(action_enablers_for_action(paction->id)) + == 0) { + /* Not relevant. */ + continue; + } + /* Impossible hard requirement. */ if (!action_is_in_use(paction)) { /* Make sure that all action enablers are disabled. */ -- 2.20.1