diff --git a/ui/app/adapters/secret-engine.js b/ui/app/adapters/secret-engine.js index ad8e3b732..945240510 100644 --- a/ui/app/adapters/secret-engine.js +++ b/ui/app/adapters/secret-engine.js @@ -31,14 +31,17 @@ export default ApplicationAdapter.extend({ mountModel = await this.ajax(this.internalURL(query.path), 'GET'); // if kv2 then add the config data to the mountModel // version comes in as a string - if (mountModel.data.type === 'kv' && mountModel.data.options.version === '2') { + if (mountModel?.data?.type === 'kv' && mountModel?.data?.options?.version === '2') { configModel = await this.ajax(this.urlForConfig(query.path), 'GET'); mountModel.data = { ...mountModel.data, ...configModel.data }; } } catch (error) { + // no path means this was an error on listing + if (!query.path) { + throw error; + } // control groups will throw a 403 permission denied error. If this happens return the mountModel // error is handled on routing - console.log(error); } return mountModel; },