From 8f823ac7fc578e85415824220db3e06e01de0437 Mon Sep 17 00:00:00 2001 From: sanine-a Date: Tue, 15 Dec 2020 20:32:01 -0600 Subject: fix non-skipping bug in honey_lua_parse_params --- src/honey_lua.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/honey_lua.c') diff --git a/src/honey_lua.c b/src/honey_lua.c index 307f4c6..1d199c2 100644 --- a/src/honey_lua.c +++ b/src/honey_lua.c @@ -263,9 +263,12 @@ void honey_lua_parse_params(lua_State* L, int n, int m, ...) void* data = va_arg(args, void*); lua_getfield(L, table_index, param); - if (lua_isnil(L, -1) && n < m) - honey_lua_throw_error - (L, "required parameter '%s' was not found in param table!", param); + if (lua_isnil(L, -1)) { + if (n < m) + honey_lua_throw_error + (L, "required parameter '%s' was not found in param table!", param); + continue; + } if (!check_argument(L, type, -1)) honey_lua_throw_error -- cgit v1.2.1