diff --git a/src/Symfony/Bridge/Twig/Command/DebugCommand.php b/src/Symfony/Bridge/Twig/Command/DebugCommand.php index bb81615a6c..27482e732c 100644 --- a/src/Symfony/Bridge/Twig/Command/DebugCommand.php +++ b/src/Symfony/Bridge/Twig/Command/DebugCommand.php @@ -83,6 +83,13 @@ EOF protected function execute(InputInterface $input, OutputInterface $output) { $twig = $this->getTwigEnvironment(); + + if (null === $twig) { + $output->writeln('The Twig environment needs to be set.'); + + return 1; + } + $types = array('functions', 'filters', 'tests', 'globals'); if ($input->getOption('format') === 'json') {