From a3d54635e0c43fbfaef0ba440e93d0df9189c9fe Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 3 Oct 2023 19:58:55 +0200 Subject: [PATCH] Prevent epic crash when domain_portal_urls or permissions are not defined in the conf --- config.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config.lua b/config.lua index a7ac64f..0bdcc54 100644 --- a/config.lua +++ b/config.lua @@ -87,6 +87,15 @@ function get_config() end end + -- Define empty dict if conf file is empty~ish, + -- to at least avoid miserably crashing later + if conf["domain_portal_urls"] == nil then + conf["domain_portal_urls"] = {} + end + if conf["permissions"] == nil then + conf["permissions"] = {} + end + -- Always skip the portal urls to avoid redirection looping. for domain, portal_url in pairs(conf["domain_portal_urls"]) do table.insert(conf["permissions"]["core_skipped"]["uris"], portal_url)