diff --git a/Twig/DataGridExtension.php b/Twig/DataGridExtension.php index 77f37b1b..df4439f5 100644 --- a/Twig/DataGridExtension.php +++ b/Twig/DataGridExtension.php @@ -452,7 +452,7 @@ protected function getTemplatesFromString(Twig_Environment $environment, $theme) $this->templates = []; $template = $environment->loadTemplate($theme); - while ($template !== null) { + while ($template instanceof \Twig_Template) { $this->templates[] = $template; $template = $template->getParent([]); }