From 62747cee2767fcd856bebfbd6682f03440718ac8 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Tue, 2 Sep 2025 14:21:58 +0200 Subject: [PATCH] Avoid errors when failing to guess the template info for an error --- src/Error/Error.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Error/Error.php b/src/Error/Error.php index 22ec219e9..97ed2df99 100644 --- a/src/Error/Error.php +++ b/src/Error/Error.php @@ -148,6 +148,10 @@ class Error extends \Exception } } + if (null === $template) { + return; // Impossible to guess the info as the template was not found in the backtrace + } + $r = new \ReflectionObject($template); $file = $r->getFileName();