Skip to content

Commit

Permalink
fix: passing null to explode() function
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jvillal-amp authored and JohnVillalovos committed Jul 10, 2024
1 parent f904146 commit 981862a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Domain/CustomAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class CustomAttribute
protected $adminOnly = false;

/**
* @var string
* @var string|null
*/
protected $possibleValues;

Expand Down Expand Up @@ -134,6 +134,9 @@ public function PossibleValues()
*/
public function PossibleValueList()
{
if (is_null($this->possibleValues)) {
return [];
}
return explode(',', $this->possibleValues);
}

Expand Down

0 comments on commit 981862a

Please sign in to comment.