mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 13:37:07 +00:00
Do not fail if requested object does not exist
This commit is contained in:
@@ -18,7 +18,8 @@ async function get (projectId, path, opts = {}) {
|
||||
: res.rows.map(r => r.data);
|
||||
|
||||
if (path) {
|
||||
return path.split('/').reduce( (obj, idx) => obj[idx], config);
|
||||
return path.split('/').filter(i => i !== "").reduce( (obj, idx) =>
|
||||
typeof obj !== 'undefined' ? obj[idx] : undefined, config);
|
||||
} else {
|
||||
return config;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user