From ac71f841dc6bd2f46d221611ef681630d10a0352 Mon Sep 17 00:00:00 2001 From: Isaac0-dev <62234577+Isaac0-dev@users.noreply.github.com> Date: Mon, 10 Mar 2025 10:57:33 +1000 Subject: [PATCH] fix nil objects crashing parts of the game --- src/pc/lua/smlua_utils.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pc/lua/smlua_utils.c b/src/pc/lua/smlua_utils.c index 82def95e8..4cdec544a 100644 --- a/src/pc/lua/smlua_utils.c +++ b/src/pc/lua/smlua_utils.c @@ -150,7 +150,6 @@ bool smlua_is_cobject(lua_State* L, int index, UNUSED u16 lot) { 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_TUSERDATA) { LOG_LUA_LINE("smlua_to_cobject received improper type '%d'", indexType); gSmLuaConvertSuccess = false; @@ -177,7 +176,6 @@ void* smlua_to_cobject(lua_State* L, int index, u16 lot) { void* smlua_to_cpointer(lua_State* L, int index, u16 lvt) { s32 indexType = lua_type(L, index); - if (indexType == LUA_TNIL) { return NULL; } if (indexType != LUA_TUSERDATA) { LOG_LUA_LINE("smlua_to_cpointer received improper type '%d'", indexType); gSmLuaConvertSuccess = false;