diff --git a/src/Symfony/Bundle/FrameworkBundle/EventListener/ConsoleProfilerListener.php b/src/Symfony/Bundle/FrameworkBundle/EventListener/ConsoleProfilerListener.php index f9a55a62e23b9..d3fc3810631b6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/EventListener/ConsoleProfilerListener.php +++ b/src/Symfony/Bundle/FrameworkBundle/EventListener/ConsoleProfilerListener.php @@ -59,7 +59,8 @@ public static function getSubscribedEvents(): array public function initialize(ConsoleCommandEvent $event): void { - if (!$event->getInput()->getOption('profile')) { + $input = $event->getInput(); + if (!$input->hasOption('profile') || !$input->getOption('profile')) { $this->profiler->disable(); return;