diff --git a/src/pc/lua/smlua_utils.c b/src/pc/lua/smlua_utils.c index 72d9dcb1..598cfc31 100644 --- a/src/pc/lua/smlua_utils.c +++ b/src/pc/lua/smlua_utils.c @@ -103,6 +103,7 @@ LuaFunction smlua_to_lua_function(lua_State* L, int index) { void* smlua_to_cobject(lua_State* L, int index, u16 lot) { s32 indexType = lua_type(L, index); + if (indexType == LUA_TNIL) { return NULL; } if (indexType != LUA_TTABLE) { LOG_LUA_LINE("smlua_to_cobject received improper type '%d'", lua_type(L, index)); gSmLuaConvertSuccess = false;