-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Symfony version(s) affected
6.2
Description
A null pointer exception thrown on profiler "Notifications" tab when an event message with null
notification is collected.
This bug only happen when symfony/notifier and symfony/messenger are installed simultaneous.
Error screenshot
web-profiler-bundle/Resources/views/Collector/notifier.html.twig (Line 117 and 131)
{% if message.getNotification is defined %}
<div class="card-block">
<div class="row">
<div class="col">
<span class="label">Content</span>
<pre class="prewrap">{{ message.getNotification().getContent() ?? '(empty)' }}</pre>
<span class="label">Importance</span>
<pre class="prewrap">{{ message.getNotification().getImportance() }}</pre>
</div>
</div>
</div>
{% endif %}
$notification
property is defined but is null
How to reproduce
https://github.com/jjfufu/sf-web-profiler-notifications
Possible Solution
Possibly add and message.getNotification is not null
to condition. And a specific display in the other case ?
Additional Context
This bug only happen when symfony/notifier and symfony/messenger are installed simultaneous.