From f80dd66ecc8af203b03cf010da3a37ffbce165f6 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Fri, 15 Nov 2024 16:44:57 +0100 Subject: [PATCH] fix a warning in webhook trigger (#31850) * fix a warnign in webhook trigger * better fix --------- Co-authored-by: Hystepik Co-authored-by: Laurent Destailleur --- .../triggers/interface_95_modWebhook_WebhookTriggers.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php b/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php index 1ae1e322ea0..2d16d54ed99 100644 --- a/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php +++ b/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php @@ -76,6 +76,9 @@ class InterfaceWebhookTriggers extends DolibarrTriggers $errors = 0; $static_object = new Target($this->db); $target_url = $static_object->fetchAll(); + if (!is_array($target_url)) { + return 0; + } foreach ($target_url as $key => $tmpobject) { $actionarray = explode(",", $tmpobject->trigger_codes); if ($tmpobject->status == Target::STATUS_VALIDATED && is_array($actionarray) && in_array($action, $actionarray)) {