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```
This commit is contained in:
parent
fc56a5cefa
commit
884368e709
@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user