check parameters for minetest.log lua function

stable-0.4
sapier 2013-01-26 10:32:08 +00:00
parent c691d619c2
commit eb2a8fe8b8
1 changed files with 2 additions and 2 deletions

View File

@ -4415,8 +4415,8 @@ static int l_log(lua_State *L)
} }
else else
{ {
std::string levelname = lua_tostring(L, 1); std::string levelname = luaL_checkstring(L, 1);
text = lua_tostring(L, 2); text = luaL_checkstring(L, 2);
if(levelname == "error") if(levelname == "error")
level = LMT_ERROR; level = LMT_ERROR;
else if(levelname == "action") else if(levelname == "action")