From 739900a2bc396d3559c04f415d05bd1a6fb6f67d Mon Sep 17 00:00:00 2001
From: Herman van Rink <rink@initfour.nl>
Date: Mon, 1 Apr 2024 23:09:52 +0200
Subject: [PATCH] Initialize state_out eralier, for case with no actions, #6591

---
 server/lib/classes/plugins.inc.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/lib/classes/plugins.inc.php b/server/lib/classes/plugins.inc.php
index 9b9b143776..3a1886238a 100644
--- a/server/lib/classes/plugins.inc.php
+++ b/server/lib/classes/plugins.inc.php
@@ -145,12 +145,12 @@ class plugins {
 		if($this->debug) $app->log('Raised action: '.$action_name, LOGLEVEL_DEBUG);
 
 		$result = '';
+		$state_out = 'ok';
 
 		if(is_array($actions)) {
 			foreach($actions as $action) {
 				$plugin_name = $action['plugin'];
 				$function_name = $action['function'];
-				$state_out = 'ok';
 				//* Call the processing function of the plugin
 				$app->log("Calling function '$function_name' from plugin '$plugin_name' raised by action '$action_name'.", LOGLEVEL_DEBUG);
 				$state = call_user_func(array($app->loaded_plugins[$plugin_name], $function_name), $action_name, $data);
-- 
GitLab