Hexanet / MonologExtraBundle

:memo: Symfony bundle with extra processors and logger to log request/response
MIT License
3 stars 1 forks source link

ConsoleExceptionListener - command can be null #41

Closed notFloran closed 6 years ago

notFloran commented 6 years ago
$ sf hexaenet:doctor

Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function getName() on null in /Users/floranbrutel/dev/si/applications/citadel/vendor/hexanet/monolog-extra-bundle/src/EventListener/ConsoleExceptionListener.php:42
Stack trace:
#0 [internal function]: Hexanet\Common\MonologExtraBundle\EventListener\ConsoleExceptionListener->onConsoleException(Object(Symfony\Component\Console\Event\ConsoleErrorEvent), 'console.error', Object(Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher))
#1 /Users/floranbrutel/dev/si/applications/citadel/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php(104): call_user_func(Array, Object(Symfony\Component\Console\Event\ConsoleErrorEvent), 'console.error', Object(Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher))
#2 /Users/floranbrutel/dev/si/applications/citadel/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php(212): Symfony\Component\EventDispatcher\Debug\WrappedListener in /Users/floranbrutel/dev/si/applications/citadel/vendor/hexanet/monolog-extra-bundle/src/EventListener/ConsoleExceptionListener.php on line 42

$event->getCommand(); return Command or null : we need to adapt the ConsoleExceptionListener