Skip to content

Commit a3a4a99

Browse files
committed
fix(metadata): loop on operations can be null
1 parent e03e9a1 commit a3a4a99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Metadata/Resource/Factory/BackedEnumResourceMetadataCollectionFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function create(string $resourceClass): ResourceMetadataCollection
3838

3939
foreach ($resourceMetadataCollection as $i => $resourceMetadata) {
4040
$newOperations = [];
41-
foreach ($resourceMetadata->getOperations() as $operationName => $operation) {
41+
foreach ($resourceMetadata->getOperations() ?? [] as $operationName => $operation) {
4242
$newOperations[$operationName] = $operation;
4343

4444
if (null !== $operation->getProvider()) {
@@ -49,7 +49,7 @@ public function create(string $resourceClass): ResourceMetadataCollection
4949
}
5050

5151
$newGraphQlOperations = [];
52-
foreach ($resourceMetadata->getGraphQlOperations() as $operationName => $operation) {
52+
foreach ($resourceMetadata->getGraphQlOperations() ?? [] as $operationName => $operation) {
5353
$newGraphQlOperations[$operationName] = $operation;
5454

5555
if (null !== $operation->getProvider()) {

0 commit comments

Comments
 (0)