From add45b4e60167d3c74ce04752517e3eb96a8234c Mon Sep 17 00:00:00 2001 From: jacob1 Date: Mon, 20 Jan 2014 11:33:18 -0500 Subject: [PATCH] fix crash with gfx.drawText() --- src/cat/LuaScriptInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cat/LuaScriptInterface.cpp b/src/cat/LuaScriptInterface.cpp index 333555902..348b8351c 100644 --- a/src/cat/LuaScriptInterface.cpp +++ b/src/cat/LuaScriptInterface.cpp @@ -2359,7 +2359,7 @@ int LuaScriptInterface::graphics_drawText(lua_State * l) { int x = lua_tointeger(l, 1); int y = lua_tointeger(l, 2); - char * text = (char*)lua_tostring(l, 3); + char * text = (char*)luaL_optstring(l, 3, ""); int r = luaL_optint(l, 4, 255); int g = luaL_optint(l, 5, 255); int b = luaL_optint(l, 6, 255);