From 884368e7095073ced91be29a91571415ab65ff62 Mon Sep 17 00:00:00 2001 From: Stepan Anchugov Date: Fri, 22 Jan 2016 04:44:07 +0500 Subject: [PATCH] Throw for missing container extensions This covers cases when a bundle does not have an extension, which lead to FatalErrorException with ```Call to a member function getAlias() on null``` --- .../Bundle/FrameworkBundle/Command/AbstractConfigCommand.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php index 711934c73a..d1e0f9c771 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php @@ -57,6 +57,10 @@ abstract class AbstractConfigCommand extends ContainerDebugCommand $bundles = $this->initializeBundles(); foreach ($bundles as $bundle) { if ($name === $bundle->getName()) { + if (!$bundle->getContainerExtension()) { + throw new \LogicException(sprintf('Bundle "%s" does not have a container extension.', $name)); + } + return $bundle->getContainerExtension(); }