patch 9.0.1320: checking the type of a null object causes a crash
Problem: Checking the type of a null object causes a crash.
Solution: Don't try to get the class of a null object. (closes #12005)
Handle error from calling a user function better.
diff --git a/src/if_lua.c b/src/if_lua.c
index 45f233f..6559550 100644
--- a/src/if_lua.c
+++ b/src/if_lua.c
@@ -2776,11 +2776,11 @@
if (lua_pcall(funcstate->L, luaargcount, 1, 0))
{
luaV_emsg(funcstate->L);
- return FCERR_OTHER;
+ return (int)FCERR_OTHER;
}
luaV_checktypval(funcstate->L, -1, rettv, "get return value");
- return FCERR_NONE;
+ return (int)FCERR_NONE;
}
/*