Skip to content

Commit

Permalink
fix(metadata): reader should be nullable (#5378)
Browse files Browse the repository at this point in the history
  • Loading branch information
louismariegaborit committed Jan 27, 2023
1 parent dc11c73 commit 1983089
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ public function create(string $resourceClass, string $property, array $options =
return $this->updateMetadata($attributes[0]->newInstance(), $propertyMetadata, $resourceClass, $property);
}

if (!$this->reader) {
return $propertyMetadata;
}

$annotation = $this->reader->getMethodAnnotation($reflectionMethod, ApiSubresource::class);
if ($annotation instanceof ApiSubresource) {
return $this->updateMetadata($annotation, $propertyMetadata, $resourceClass, $property);
Expand Down

0 comments on commit 1983089

Please sign in to comment.