From 981862a29fa04827f27bb051cd862f80408fa131 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Tue, 9 Jul 2024 10:35:59 -0700 Subject: [PATCH] fix: passing null to `explode()` function When calling the `GetCategoryAttributes` API, got an error: The application could not run because of the following error: Details Code: 8192 Message: explode(): Passing null to parameter #2 ($string) of type string is deprecated File: /var/www/html/Domain/CustomAttribute.php Line: 137 --- Domain/CustomAttribute.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Domain/CustomAttribute.php b/Domain/CustomAttribute.php index ea67a8543..62d1bd97a 100644 --- a/Domain/CustomAttribute.php +++ b/Domain/CustomAttribute.php @@ -76,7 +76,7 @@ class CustomAttribute protected $adminOnly = false; /** - * @var string + * @var string|null */ protected $possibleValues; @@ -134,6 +134,9 @@ public function PossibleValues() */ public function PossibleValueList() { + if (is_null($this->possibleValues)) { + return []; + } return explode(',', $this->possibleValues); }