Skip to content

Commit

Permalink
Throw for missing container extensions
Browse files Browse the repository at this point in the history
This covers cases when a bundle does not have an extension, which
lead to FatalErrorException with ```Call to a member function getAlias() on null```
  • Loading branch information
kix authored and fabpot committed Jan 25, 2016
1 parent fc56a5c commit 884368e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ protected function findExtension($name)
$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();
}

Expand Down

0 comments on commit 884368e

Please sign in to comment.