lua/api: fix impl_module_new arg parse
This commit is contained in:

committed by
saivert

parent
4585ee08c9
commit
27a6970de5
@@ -1326,12 +1326,12 @@ impl_module_new (lua_State *L)
|
||||
|
||||
name = luaL_checkstring (L, 1);
|
||||
|
||||
if (lua_type (L, 2) != LUA_TNONE)
|
||||
if (lua_type (L, 2) != LUA_TNONE && lua_type (L, 2) != LUA_TNIL)
|
||||
args = luaL_checkstring (L, 2);
|
||||
|
||||
if (lua_type (L, 3) != LUA_TNONE) {
|
||||
if (lua_type (L, 3) != LUA_TNONE && lua_type (L, 3) != LUA_TNIL) {
|
||||
luaL_checktype (L, 3, LUA_TTABLE);
|
||||
properties = wplua_table_to_properties (L, 2);
|
||||
properties = wplua_table_to_properties (L, 3);
|
||||
}
|
||||
|
||||
WpImplModule *m = wp_impl_module_load (get_wp_export_core (L),
|
||||
|
Reference in New Issue
Block a user