Cope with non-existing configuration paths.

Fixes #212.
This commit is contained in:
D. Berge
2022-05-02 13:15:41 +02:00
parent 10883eb1a6
commit f46fd4b6bc

View File

@@ -19,7 +19,7 @@ async function get (projectId, path, opts = {}) {
if (path) {
return path.split('/').filter(i => i !== "").reduce( (obj, idx) =>
typeof obj !== 'undefined' ? obj[idx] : undefined, config);
(typeof obj !== 'undefined' && obj !== null) ? obj[idx] : undefined, config);
} else {
return config;
}