Make sure an empty config is generated if the JSON is missing

This commit is contained in:
Struma 2021-06-24 16:44:00 -04:00 committed by Roza
parent 9920de87f8
commit bb7cd9faa0

View file

@ -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)