fix error handling

This commit is contained in:
Glenn Maynard
2006-10-09 01:15:09 +00:00
parent 40b8df3488
commit afa611c36d
+3 -5
View File
@@ -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;