From 5bed18614b25dec31f5f65bf745dfd212fe251a5 Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Thu, 4 Aug 2022 14:51:37 +0200 Subject: [PATCH] fix: [correlation:getRelatedAttribute] Always return an array --- app/Model/Correlation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Model/Correlation.php b/app/Model/Correlation.php index c70175e07..bb1025f20 100644 --- a/app/Model/Correlation.php +++ b/app/Model/Correlation.php @@ -830,12 +830,12 @@ class Correlation extends AppModel * @param array $attribute Attribute Array * @param array $fields List of fields to include * @param bool $includeEventData Flag to include the event data in the response - * @return array|null + * @return array */ - public function getRelatedAttributes($user, $sgids, $attribute, $fields=[], $includeEventData = false) + public function getRelatedAttributes($user, $sgids, $attribute, $fields=[], $includeEventData = false): array { if (in_array($attribute['type'], Attribute::NON_CORRELATING_TYPES)) { - return null; + return []; } return $this->runGetRelatedAttributes($user, $sgids, $attribute, $fields, $includeEventData); }