diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php index cc76a3e94184eae5a1447affd797fcc0df497276..1bad9c98d65d8c3774678713d25241ddbd7a2d08 100644 --- a/lib/SimpleSAML/XHTML/Template.php +++ b/lib/SimpleSAML/XHTML/Template.php @@ -131,9 +131,6 @@ class SimpleSAML_XHTML_Template foreach ($templateDirs as $entry) { $loader->addPath($entry[key($entry)], key($entry)); } - if (!$loader->exists($this->twig_template)) { - return false; - } return $loader; } @@ -151,7 +148,8 @@ class SimpleSAML_XHTML_Template } // set up template paths $loader = $this->setupTwigTemplatepaths(); - if (!$loader) { + // abort if twig template does not exist + if (!$loader->exists($this->twig_template)) { return null; }