Check for table type when reading groups from Lua
authordarkrose <lisa@ltmnet.com>
Sun, 15 Jul 2012 06:50:42 +0000 (16:50 +1000)
committerPerttu Ahola <celeron55@gmail.com>
Fri, 20 Jul 2012 23:35:45 +0000 (02:35 +0300)
src/scriptapi.cpp

index 4b3fbe2968822a6360f60c9b4a1191897dc831c2..39e89ddb59c63002a94730f4a26c8c56c3247c21 100644 (file)
@@ -686,6 +686,8 @@ static NodeBox read_nodebox(lua_State *L, int index)
 static void read_groups(lua_State *L, int index,
                std::map<std::string, int> &result)
 {
+       if (!lua_istable(L,index))
+               return;
        result.clear();
        lua_pushnil(L);
        if(index < 0)