Fix trying to read uninitialized properties when fetching call stack during exception handling

"Typed property ... must not be accessed before initialization" error was displayed instead of CakePHP error page with call stack
This commit is contained in:
daris 2023-10-26 10:34:46 +02:00 committed by Kamil Wylegala
parent 1cd99ff3e0
commit 1a06136cb0

View file

@ -593,6 +593,11 @@ class Debugger {
$reflectionProperties = $ref->getProperties($filter);
foreach ($reflectionProperties as $reflectionProperty) {
$reflectionProperty->setAccessible(true);
if (!$reflectionProperty->isInitialized($var)) {
continue;
}
$property = $reflectionProperty->getValue($var);
$value = static::_export($property, $depth - 1, $indent);