summaryrefslogtreecommitdiff
path: root/lib/frrscript.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/frrscript.h')
-rw-r--r--lib/frrscript.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/frrscript.h b/lib/frrscript.h
index 0d5568d342..1e35e2ee41 100644
--- a/lib/frrscript.h
+++ b/lib/frrscript.h
@@ -123,7 +123,12 @@ void frrscript_init(const char *scriptdir);
#define DECODE_ARGS(name, value) \
do { \
lua_getfield(lfs->L, 1, name); \
- DECODE_ARGS_WITH_STATE(lfs->L, value); \
+ if (lua_isnil(lfs->L, 2)) { \
+ lua_pop(lfs->L, 1); \
+ } else { \
+ DECODE_ARGS_WITH_STATE(lfs->L, value); \
+ } \
+ assert(lua_gettop(lfs->L) == 1); \
} while (0)
/*