Apply suggestions from code review

Co-authored-by: Gauthier Dandele <92022724+GogoVega@users.noreply.github.com>
This commit is contained in:
Nick O'Leary
2024-12-06 13:45:48 +00:00
committed by GitHub
parent 4e61c54be5
commit 66bd1feb47
2 changed files with 12 additions and 0 deletions

View File

@@ -855,6 +855,12 @@ RED.editor = (function() {
for (const prop in editing_node._def.credentials) {
if (Object.prototype.hasOwnProperty.call(editing_node._def.credentials, prop)) {
if (oldCreds[prop] !== editing_node.credentials[prop]) {
if (editing_node.credentials[prop] === '__PWRD__') {
// The password may not exist in oldCreds
// The value '__PWRD__' means the password exists,
// so ignore this change
continue;
}
editState.changes.credentials = editState.changes.credentials || {};
editState.changes.credentials[prop] = oldCreds[prop];
editState.changed = true;