fix error handling
This commit is contained in:
@@ -83,11 +83,9 @@ namespace
|
|||||||
{
|
{
|
||||||
luaL_checktype( L, 1, LUA_TTABLE );
|
luaL_checktype( L, 1, LUA_TTABLE );
|
||||||
|
|
||||||
/* Look up the reverse table. */
|
/* Look up the reverse table. If there is no metafield, then we were
|
||||||
luaL_getmetafield( L, 1, "reverse" );
|
* called on the wrong type. */
|
||||||
|
if( !luaL_getmetafield(L, 1, "reverse") )
|
||||||
/* If there was no metafield, then we were called on the wrong type. */
|
|
||||||
if( lua_isnil(L, -1) )
|
|
||||||
luaL_typerror( L, 1, "enum" );
|
luaL_typerror( L, 1, "enum" );
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user