[Console] Fixed fatal error when the command is not defined

This commit is contained in:
Grégoire Pineau 2017-03-24 11:19:00 +01:00
parent 2ad59231c6
commit d5b41b6b0a

View File

@ -127,7 +127,7 @@ class Application
$exception = new FatalThrowableError($e);
}
if (null !== $e && null !== $this->dispatcher) {
if (null !== $this->runningCommand && null !== $e && null !== $this->dispatcher) {
$event = new ConsoleErrorEvent($this->runningCommand, $input, $output, $e, $e->getCode());
$this->dispatcher->dispatch(ConsoleEvents::ERROR, $event);