diff --git a/backend/utils/common.js b/backend/utils/common.js index de988150..797bf8b5 100644 --- a/backend/utils/common.js +++ b/backend/utils/common.js @@ -40,11 +40,13 @@ export class CommonService { return obj; }; this.removeAuthSecureData = (node) => { - delete node.authentication.macaroonPath; - delete node.authentication.runePath; - delete node.authentication.runeValue; - delete node.authentication.lnApiPassword; - delete node.authentication.options; + if (node.authentication) { + delete node.authentication.macaroonPath; + delete node.authentication.runePath; + delete node.authentication.runeValue; + delete node.authentication.lnApiPassword; + delete node.authentication.options; + } return node; }; this.removeSecureData = (config) => { diff --git a/server/utils/common.ts b/server/utils/common.ts index 654d8655..165d6df5 100644 --- a/server/utils/common.ts +++ b/server/utils/common.ts @@ -47,11 +47,13 @@ export class CommonService { }; public removeAuthSecureData = (node: SelectedNode) => { - delete node.authentication.macaroonPath; - delete node.authentication.runePath; - delete node.authentication.runeValue; - delete node.authentication.lnApiPassword; - delete node.authentication.options; + if (node.authentication) { + delete node.authentication.macaroonPath; + delete node.authentication.runePath; + delete node.authentication.runeValue; + delete node.authentication.lnApiPassword; + delete node.authentication.options; + } return node; };