Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f988bdd

Browse filesBrowse files
committed
bug #49310 [Notifier][WebProfilerBundle] Ignore messages whose getNotification returns null (MatTheCat)
This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [Notifier][WebProfilerBundle] Ignore messages whose `getNotification` returns `null` | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #49305 | License | MIT | Doc PR | N/A Make use of Twig’s null-coalescing operator because `MessageInterface::getNotification` can return `null` when it exists. Commits ------- 0f7f223 [Notifier][WebProfilerBundle] Ignore messages whose `getNotification` returns `null`
2 parents c37a87b + 0f7f223 commit f988bdd
Copy full SHA for f988bdd

File tree

Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/notifier.html.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/notifier.html.twig
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,24 +114,24 @@
114114
<span class="label">Subject</span>
115115
<h2 class="m-t-10">{{ message.getSubject() ?? '(empty)' }}</h2>
116116
</div>
117-
{% if message.getNotification is defined %}
117+
{% set notification = message.notification ?? null %}
118+
{% if notification %}
118119
<div class="card-block">
119120
<div class="row">
120121
<div class="col">
121122
<span class="label">Content</span>
122-
<pre class="prewrap">{{ message.getNotification().getContent() ?? '(empty)' }}</pre>
123+
<pre class="prewrap">{{ notification.getContent() ?? '(empty)' }}</pre>
123124
<span class="label">Importance</span>
124-
<pre class="prewrap">{{ message.getNotification().getImportance() }}</pre>
125+
<pre class="prewrap">{{ notification.getImportance() }}</pre>
125126
</div>
126127
</div>
127128
</div>
128129
{% endif %}
129130
<div class="card-block">
130131
<div class="sf-tabs sf-tabs-sm">
131-
{% if message.getNotification is defined %}
132+
{% if notification %}
132133
<div class="tab">
133134
<h3 class="tab-title">Notification</h3>
134-
{% set notification = event.message.getNotification() %}
135135
<div class="tab-content">
136136
<pre class="prewrap" style="max-height: 600px">
137137
{{- 'Subject: ' ~ notification.getSubject() }}<br/>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.