From bb7cd9faa0443a19961a4c92d870fbd60c87249f Mon Sep 17 00:00:00 2001 From: Struma Date: Thu, 24 Jun 2021 16:44:00 -0400 Subject: [PATCH] Make sure an empty config is generated if the JSON is missing --- src/config.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/config.cpp b/src/config.cpp index 29de5ed7..bc5b3044 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -182,6 +182,9 @@ try { exp } catch (...) {} copyObject(optsJ, confData); copyObject(opts["bindingNames"], confData.as_object()["bindingNames"], "bindingNames ."); } + else { + raw = json::object({}); + } #define SET_OPT_CUSTOMKEY(var, key, type) GUARD(var = opts[#key].as_##type();) #define SET_OPT(var, type) SET_OPT_CUSTOMKEY(var, var, type)