]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Do not return raw tables as they might be uninitialized
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 7 Jul 2019 11:02:55 +0000 (12:02 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 7 Jul 2019 11:02:55 +0000 (12:02 +0100)
lualib/lua_settings.lua

index fb1a70217ed9ac641c9776dc26b565e2bb4edefe..67a33bb585464e51cce9e45f865b5c9d53ae456b 100644 (file)
@@ -211,9 +211,24 @@ end
 
 
 exports.settings_by_id = settings_by_id
-exports.all_settings = known_ids
-exports.all_symbols = all_symbols
+exports.all_settings = function()
+  if not post_init_performed then
+    register_settings_cb()
+  end
+  return known_ids
+end
+exports.all_symbols = function()
+  if not post_init_performed then
+    register_settings_cb()
+  end
+  return all_symbols
+end
 -- What is enabled when no settings are there
-exports.default_symbols = default_symbols
+exports.default_symbols = function()
+  if not post_init_performed then
+    register_settings_cb()
+  end
+  return default_symbols
+end
 
 return exports
\ No newline at end of file