fix nil objects crashing parts of the game

This commit is contained in:
Isaac0-dev 2025-03-10 10:57:33 +10:00
parent 9d1776410c
commit ac71f841dc

View file

@ -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;