From c470c0328a1c44d72009f9a89297a4384cdee6d5 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Tue, 6 Mar 2012 12:31:51 +0100 Subject: [PATCH] renderUtf8Text shouldn't die witout a text this is exposed by #38 and #40 --- rendertext.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rendertext.lua b/rendertext.lua index 2317b8669..56822f98f 100644 --- a/rendertext.lua +++ b/rendertext.lua @@ -44,6 +44,10 @@ function clearglyphcache() end function renderUtf8Text(buffer, x, y, face, facehash, text, kerning) + if text == nil then + print("# renderUtf8Text called without text"); + return + end -- may still need more adaptive pen placement when kerning, -- see: http://freetype.org/freetype2/docs/glyphs/glyphs-4.html local pen_x = 0