You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// save profiles
foreach ($this->profiles as $r) {
$p = $this->profiles[$r];
$this->profiler->saveProfile($p); // <-- no check here if $p actually exists
// etc...
}
This causes the following exception:
[TypeError]
Symfony\Component\HttpKernel\Profiler\Profiler::saveProfile(): Argument #1 ($profile) must be of type Symfony\Component\HttpKernel\Profiler\Profile, null given, called in /my_project/
vendor/symfony/framework-bundle/EventListener/ConsoleProfilerListener.php on line 147
How to reproduce
This happens to me when calling a specific command with the --profile argument. I realize this doesn't happen with other commands, but I think anyway the missing check should be added for more consistency
Possible Solution
Replace the code above with the following:
// save profiles
foreach ($this->profiles as $r) {
$p = $this->profiles[$r];
if (null === $p) {
continue;
}
$this->profiler->saveProfile($p);
// etc...
}
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Symfony version(s) affected
7.3.0-beta2
Description
As you can see here https://github.com/symfony/symfony/blob/7.3/src/Symfony/Bundle/FrameworkBundle/EventListener/ConsoleProfilerListener.php#L146
This causes the following exception:
How to reproduce
This happens to me when calling a specific command with the
--profile
argument. I realize this doesn't happen with other commands, but I think anyway the missing check should be added for more consistencyPossible Solution
Replace the code above with the following:
Additional Context
No response
The text was updated successfully, but these errors were encountered: