Skip to content

Commit

Permalink
Merge pull request #602 from jmolivas/validate-helper-objects-in-appl…
Browse files Browse the repository at this point in the history
…ication

Validate helper objects in Application class
  • Loading branch information
jmolivas committed Apr 17, 2015
2 parents bfee7c1 + e823edf commit 5bb3f3e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,10 @@ protected function doKernelConfiguration()
public function bootstrap()
{
$kernelHelper = $this->getHelperSet()->get('kernel');
$kernelHelper->bootKernel();
$kernelHelper->initCommands($this->all());
if ($kernelHelper){
$kernelHelper->bootKernel();
$kernelHelper->initCommands($this->all());
}

if (!$this->commandsRegistered) {
$this->commandsRegistered = $this->registerCommands();
Expand All @@ -252,9 +254,10 @@ public function bootstrap()
protected function registerCommands()
{
/** @var \Drupal\AppConsole\Command\Helper\RegisterCommandsHelper $rc */
$rc = $this->getHelperSet()->get('register_commands');

$rc->register();
$registerCommands = $this->getHelperSet()->get('register_commands');
if ($registerCommands){
$registerCommands->register();
}
}

/**
Expand Down

0 comments on commit 5bb3f3e

Please sign in to comment.