diff options
-rw-r--r-- | src/lua/lua_map.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lua/lua_map.c b/src/lua/lua_map.c index 3e292f4d3..6300216de 100644 --- a/src/lua/lua_map.c +++ b/src/lua/lua_map.c @@ -384,9 +384,12 @@ lua_config_add_map (lua_State *L) g_assert (map_obj != NULL); - if (type == NULL) { + if (type == NULL && cbidx != -1) { type = "callback"; } + else if (type == NULL) { + return luaL_error (L, "invalid map type"); + } if (strcmp (type, "callback") == 0) { map = rspamd_mempool_alloc0 (cfg->cfg_pool, sizeof (*map)); |