diff --git a/src/Symfony/Bridge/Twig/Command/LintCommand.php b/src/Symfony/Bridge/Twig/Command/LintCommand.php index 276b6b9672..243804ccb5 100644 --- a/src/Symfony/Bridge/Twig/Command/LintCommand.php +++ b/src/Symfony/Bridge/Twig/Command/LintCommand.php @@ -87,6 +87,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; + } + $filename = $input->getArgument('filename'); if (!$filename) {