src/gui/lua/lua_cc_text.cpp avoid segfault

Origin commit data
------------------
Branch: ni/coolstream
Commit: ffe986f36b
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2017-05-17 (Wed, 17 May 2017)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2017-05-17 22:15:15 +02:00
parent f58c1d0089
commit f183446d5c

View File

@@ -208,10 +208,11 @@ int CLuaInstCCText::CCTextSetText(lua_State *L)
std::string text = "";
lua_Integer mode = D->mode;
lua_Integer font_text = D->font_text;
tableLookup(L, "text", text);
tableLookup(L, "mode", mode);
tableLookup(L, "font_text", font_text);
if (lua_istable(L, -1)){
tableLookup(L, "text", text);
tableLookup(L, "mode", mode);
tableLookup(L, "font_text", font_text);
}
D->ct->setText(text, mode, g_Font[font_text]);
return 0;
}