From 1a06136cb05d716e0a427160f7f42073e06115ee Mon Sep 17 00:00:00 2001 From: daris Date: Thu, 26 Oct 2023 10:34:46 +0200 Subject: [PATCH] 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 --- lib/Cake/Utility/Debugger.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Cake/Utility/Debugger.php b/lib/Cake/Utility/Debugger.php index ef906659e..e71e0ea5e 100644 --- a/lib/Cake/Utility/Debugger.php +++ b/lib/Cake/Utility/Debugger.php @@ -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);