Skip to content

Commit 1983089

Browse files
fix(metadata): reader should be nullable (api-platform#5378)
1 parent dc11c73 commit 1983089

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Core/Metadata/Property/Factory/AnnotationSubresourceMetadataFactory.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ public function create(string $resourceClass, string $property, array $options =
8383
return $this->updateMetadata($attributes[0]->newInstance(), $propertyMetadata, $resourceClass, $property);
8484
}
8585

86+
if (!$this->reader) {
87+
return $propertyMetadata;
88+
}
89+
8690
$annotation = $this->reader->getMethodAnnotation($reflectionMethod, ApiSubresource::class);
8791
if ($annotation instanceof ApiSubresource) {
8892
return $this->updateMetadata($annotation, $propertyMetadata, $resourceClass, $property);

0 commit comments

Comments
 (0)