diff --git a/src/Error/Error.php b/src/Error/Error.php index d0d2ea36b..13e8eefad 100644 --- a/src/Error/Error.php +++ b/src/Error/Error.php @@ -139,15 +139,11 @@ class Error extends \Exception $this->lineno = 0; $template = null; - $templateClass = null; $backtrace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS | \DEBUG_BACKTRACE_PROVIDE_OBJECT); foreach ($backtrace as $trace) { if (isset($trace['object']) && $trace['object'] instanceof Template) { - $currentClass = \get_class($trace['object']); - $isEmbedContainer = null === $templateClass ? false : str_starts_with($templateClass, $currentClass); - if ($this->source->getName() === $trace['object']->getTemplateName() && !$isEmbedContainer) { + if ($this->source->getName() === $trace['object']->getTemplateName()) { $template = $trace['object']; - $templateClass = \get_class($trace['object']); break; }