Skip to content

Commit

Permalink
Explicitly check for null value
Browse files Browse the repository at this point in the history
  • Loading branch information
theilm authored Oct 23, 2024
1 parent aac709f commit 90e69d3
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ private function getAssetIdsByProperty(NodeType $nodeType, PropertyCollection $p
*/
private function extractAssetIds(string $type, mixed $value): array
{
if ($value === null) {
return [];
}
if (is_string($value)) {
preg_match_all('/asset:\/\/(?<assetId>[\w-]*)/i', $value, $matches, PREG_SET_ORDER);
return array_map(static fn (array $match) => $match['assetId'], $matches);
Expand Down

0 comments on commit 90e69d3

Please sign in to comment.