Check that there is actually an argument at that position before attempting to do something with it.
This commit is contained in:
@@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
int CheckEnum( lua_State *L, LuaReference &table, int iPos, int iInvalid, const char *szType, bool bAllowInvalid )
|
int CheckEnum( lua_State *L, LuaReference &table, int iPos, int iInvalid, const char *szType, bool bAllowInvalid )
|
||||||
{
|
{
|
||||||
|
luaL_checkany( L, iPos );
|
||||||
|
|
||||||
if( lua_isnil(L, iPos) )
|
if( lua_isnil(L, iPos) )
|
||||||
{
|
{
|
||||||
if( bAllowInvalid )
|
if( bAllowInvalid )
|
||||||
|
|||||||
@@ -226,6 +226,7 @@ bool LuaBinding::CheckLuaObjectType( lua_State *L, int iArg, const char *szType
|
|||||||
#if defined(FAST_LUA)
|
#if defined(FAST_LUA)
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
luaL_checkany( L, iArg );
|
||||||
|
|
||||||
/* Check that szType is in metatable.heirarchy. */
|
/* Check that szType is in metatable.heirarchy. */
|
||||||
if( !luaL_getmetafield(L, iArg, "heirarchy") )
|
if( !luaL_getmetafield(L, iArg, "heirarchy") )
|
||||||
|
|||||||
@@ -190,6 +190,7 @@ inline bool MyLua_checkboolean (lua_State *L, int numArg)
|
|||||||
* used to mean "cmd,false". */
|
* used to mean "cmd,false". */
|
||||||
inline bool MyLua_checkintboolean( lua_State *L, int iArg )
|
inline bool MyLua_checkintboolean( lua_State *L, int iArg )
|
||||||
{
|
{
|
||||||
|
luaL_checkany( L, iArg );
|
||||||
int iType = lua_type( L, iArg );
|
int iType = lua_type( L, iArg );
|
||||||
if( iType == LUA_TNUMBER )
|
if( iType == LUA_TNUMBER )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user