diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-04-28 09:24:36 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-04-28 09:24:36 +0100 |
commit | c9b8761d7f5ee183ae7345985cef42275692f1b5 (patch) | |
tree | 5eaee7f3ef3b2c7b9375f21714849fffa25abd0c /src/lua/lua_common.c | |
parent | f3d15b0d92afeb979959e505c740abf4bf81b9b8 (diff) | |
download | rspamd-c9b8761d7f5ee183ae7345985cef42275692f1b5.tar.gz rspamd-c9b8761d7f5ee183ae7345985cef42275692f1b5.zip |
[Test] Properly set lua paths for tests
Diffstat (limited to 'src/lua/lua_common.c')
-rw-r--r-- | src/lua/lua_common.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c index 9036955a5..fc65a67df 100644 --- a/src/lua/lua_common.c +++ b/src/lua/lua_common.c @@ -173,11 +173,13 @@ rspamd_lua_set_path (lua_State *L, struct rspamd_config *cfg) return; } - opts = ucl_object_lookup (cfg->rcl_obj, "options"); - if (opts != NULL) { - opts = ucl_object_lookup (opts, "lua_path"); - if (opts != NULL && ucl_object_type (opts) == UCL_STRING) { - additional_path = ucl_object_tostring (opts); + if (cfg) { + opts = ucl_object_lookup (cfg->rcl_obj, "options"); + if (opts != NULL) { + opts = ucl_object_lookup (opts, "lua_path"); + if (opts != NULL && ucl_object_type (opts) == UCL_STRING) { + additional_path = ucl_object_tostring (opts); + } } } |