aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_common.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-28 09:24:36 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-28 09:24:36 +0100
commitc9b8761d7f5ee183ae7345985cef42275692f1b5 (patch)
tree5eaee7f3ef3b2c7b9375f21714849fffa25abd0c /src/lua/lua_common.c
parentf3d15b0d92afeb979959e505c740abf4bf81b9b8 (diff)
downloadrspamd-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.c12
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);
+ }
}
}