From 9be3455ccca18f18c533ec63a36b144f43606080 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Wed, 27 Mar 2019 04:57:19 +0100 Subject: [PATCH] Don't crash when sizeUtf8Text is called on a nil By returning a table with the right fields instead of nil. Re #4845 --- frontend/ui/rendertext.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/ui/rendertext.lua b/frontend/ui/rendertext.lua index 6a0ca34cc..f5095652c 100644 --- a/frontend/ui/rendertext.lua +++ b/frontend/ui/rendertext.lua @@ -157,7 +157,7 @@ end function RenderText:sizeUtf8Text(x, width, face, text, kerning, bold) if not text then logger.warn("sizeUtf8Text called without text"); - return + return { x = 0, y_top = 0, y_bottom = 0 } end -- may still need more adaptive pen placement when kerning,