Skip to content

Commit 407fb5c

Browse files
committed
fix(reflection): add safety check for promoted property access
1 parent 815e0fc commit 407fb5c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/reflection/src/PropertyReflector.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ public function hasDefaultValue(): bool
151151

152152
$hasDefaultValue = $this->reflectionProperty->hasDefaultValue();
153153

154-
$hasPromotedDefaultValue = $this->isPromoted() && $constructorParameters[$this->getName()]->isDefaultValueAvailable();
154+
$hasPromotedDefaultValue = $this->isPromoted()
155+
&& isset($constructorParameters[$this->getName()])
156+
&& $constructorParameters[$this->getName()]->isDefaultValueAvailable();
155157

156158
return $hasDefaultValue || $hasPromotedDefaultValue;
157159
}

0 commit comments

Comments
 (0)