Skip to content

Commit 907ade9

Browse files
bug #50139 Check if trace.curlCommand is defined in profiler (Toflar)
This PR was merged into the 6.2 branch. Discussion ---------- Check if trace.curlCommand is defined in profiler | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | yes | New feature? | no | Deprecations? |no | Tickets | | License | MIT | Doc PR | We'll get a `Key "curlCommand" for array with keys "method, url, options, content, http_code, info" does not exist.` `RuntimeError` otherwise, if this key does not exist :) Commits ------- 39b7572 Check if trace.curlCommand is defined in profiler
2 parents 20e3259 + 39b7572 commit 907ade9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/http_client.html.twig

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
Profile
9292
</th>
9393
{% endif %}
94-
{% if trace.curlCommand is not null %}
94+
{% if trace.curlCommand is defined and trace.curlCommand %}
9595
<th>
9696
<button class="btn btn-sm hidden" title="Copy as cURL" data-clipboard-text="{{ trace.curlCommand }}">Copy as cURL</button>
9797
</th>
@@ -107,7 +107,7 @@
107107
{% endif %}
108108
<tr>
109109
<th class="font-normal">Response</th>
110-
<td{% if trace.curlCommand %} colspan="2"{% endif %}>
110+
<td{% if trace.curlCommand is defined and trace.curlCommand %} colspan="2"{% endif %}>
111111
{% if trace.http_code >= 500 %}
112112
{% set responseStatus = 'error' %}
113113
{% elseif trace.http_code >= 400 %}

0 commit comments

Comments
 (0)