Permalink
Browse files

Check if legacy engine is set before calling it (#159)

On PHP 7.3, `loadTemplate` method is somehow called before `setEzLegacyEngine` had a chance to set the legacy engine to the `Environment` class. Checking for `null` on `$this->legacyEngine` does the job apparently, with no side-effects.
  • Loading branch information...
emodric authored and andrerom committed Sep 10, 2018
1 parent dacc923 commit 557efba1fd6845c5ef9a9b1ded4cc14fa736b2d3
Showing with 1 addition and 1 deletion.
  1. +1 −1 mvc/Templating/Twig/Environment.php
@@ -38,7 +38,7 @@ public function loadTemplate($name, $index = null)
return $this->legacyTemplatesCache[$name];
}
if (is_string($name) && $this->legacyEngine->supports($name)) {
if (is_string($name) && $this->legacyEngine !== null && $this->legacyEngine->supports($name)) {
if (!$this->legacyEngine->exists($name)) {
throw new Twig_Error_Loader("Unable to find the template \"$name\"");
}

0 comments on commit 557efba

Please sign in to comment.