From 6acb58ba664dc0ef6fa7e4a1303feff4258be88e Mon Sep 17 00:00:00 2001 From: Hagen Date: Fri, 24 Jan 2020 14:13:16 +0100 Subject: [PATCH] [BUGFIX] __construct: added try catch block --- src/TwigRenderer.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/TwigRenderer.php b/src/TwigRenderer.php index 43eefae..6c0efff 100644 --- a/src/TwigRenderer.php +++ b/src/TwigRenderer.php @@ -34,7 +34,14 @@ function __construct(array $config) { if (isset($this->config['src']['namespaces'])) { foreach ($this->config['src']['namespaces'] as $namespace) { foreach ($namespace['paths'] as $path) { - $this->loader->addPath($path, $namespace['id']); + // The twigRenderer tries to access paths which + // might be not present anymore. In that case we + // have to catch this + try { + $this->loader->addPath($path, $namespace['id']); + } catch (Throwable $e) { + // ignore + } } } }