Skip to content

Commit 9e7fc19

Browse files
committed
[TwigBundle] always load the exception listener if the templating.engines is not present
1 parent 818849d commit 9e7fc19

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

DependencyInjection/Compiler/ExceptionListenerPass.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ public function process(ContainerBuilder $container)
2828
}
2929

3030
// register the exception controller only if Twig is enabled
31-
$engines = $container->getParameter('templating.engines');
32-
if (!in_array('twig', $engines)) {
33-
$container->removeDefinition('twig.exception_listener');
31+
if ($container->hasParameter('templating.engines')) {
32+
$engines = $container->getParameter('templating.engines');
33+
if (!in_array('twig', $engines)) {
34+
$container->removeDefinition('twig.exception_listener');
35+
}
3436
}
3537
}
3638
}

0 commit comments

Comments
 (0)