Skip to content

Commit 6f2e603

Browse files
bug symfony#50968 [PropertyAccess] Fix access to undefined "file" key when checking stack frames (nicolas-grekas)
This PR was merged into the 5.4 branch. Discussion ---------- [PropertyAccess] Fix access to undefined "file" key when checking stack frames | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | symfony#50967 | License | MIT | Doc PR | - Commits ------- ce75444 [PropertyAccess] Fix access to undefined "file" key when checking stack frames
2 parents 6eff7f0 + ce75444 commit 6f2e603

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/PropertyAccess/PropertyAccessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ private function readProperty(array $zval, string $property, bool $ignoreInvalid
470470
[$trace] = $e->getTrace();
471471

472472
// handle uninitialized properties in PHP >= 7
473-
if (__FILE__ === $trace['file']
473+
if (__FILE__ === ($trace['file'] ?? null)
474474
&& $name === $trace['function']
475475
&& $object instanceof $trace['class']
476476
&& preg_match('/Return value (?:of .*::\w+\(\) )?must be of (?:the )?type (\w+), null returned$/', $e->getMessage(), $matches)

0 commit comments

Comments
 (0)