From 62d197bd9240c9ac2436d9d04f440b3dd7249e08 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sat, 10 Jan 2026 04:19:39 +0200
Subject: [PATCH 60/60] sdl3: Fix error on drawing empty chatline

See RM #1884

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 client/gui-sdl3/gui_string.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/client/gui-sdl3/gui_string.c b/client/gui-sdl3/gui_string.c
index b6029fb468..189290802c 100644
--- a/client/gui-sdl3/gui_string.c
+++ b/client/gui-sdl3/gui_string.c
@@ -326,8 +326,10 @@ static SDL_Surface *create_utf8_surf(utf8_str *pstr)
               TTF_GetFontHeight(pstr->font), text->h);
     log_debug("create_utf8_surf: String is %d length", text->w);
   } else {
+    /* Likely empty (zero character) string. */
     log_debug("create_utf8_surf: text NULL");
-    text = create_surf(0, 0);
+    /* Leave text to NULL. Callers can handle it, but not e.g.
+     * zero size surface. */
   }
 
   if (!((pstr->style & 0x0F) & TTF_STYLE_NORMAL)) {
-- 
2.51.0

