Skip to content

Commit 5e44e95

Browse files
kixfabpot
authored andcommitted
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```
1 parent c9ba418 commit 5e44e95

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Command/AbstractConfigCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ protected function findExtension($name)
5757
$bundles = $this->initializeBundles();
5858
foreach ($bundles as $bundle) {
5959
if ($name === $bundle->getName()) {
60+
if (!$bundle->getContainerExtension()) {
61+
throw new \LogicException(sprintf('Bundle "%s" does not have a container extension.', $name));
62+
}
63+
6064
return $bundle->getContainerExtension();
6165
}
6266

0 commit comments

Comments
 (0)