diff --git a/core/modules/system/templates/status-messages.html.twig b/core/modules/system/templates/status-messages.html.twig
index f3fa61b..e1fd08f 100644
--- a/core/modules/system/templates/status-messages.html.twig
+++ b/core/modules/system/templates/status-messages.html.twig
@@ -44,7 +44,7 @@
           {% endfor %}
         </ul>
       {% else %}
-        {{ messages.0 }}
+        {{ messages|first }}
       {% endif %}
     {% if type == 'error' %}
       </div>
