Skip to content

Commit

Permalink
Merge pull request neos#5318 from theilm/9.0
Browse files Browse the repository at this point in the history
BUGFIX: Prevent projection failure due to missing resource
  • Loading branch information
nezaniel authored Oct 23, 2024
2 parents 288a7c5 + 90e69d3 commit 300a279
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ private function getAssetIdsByProperty(NodeType $nodeType, PropertyCollection $p
$propertyType,
$propertyValues->offsetGet($propertyName),
);
} catch (\Exception) {
} catch (\Throwable) {
$extractedAssetIds = [];
// We can't deserialize the property, so skip.
}
Expand All @@ -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 300a279

Please sign in to comment.