mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-28 15:27:03 +02:00
⚡ Overwrite credential data only if there is no data set yet
This commit is contained in:
parent
6aaae1ef6c
commit
313c8c14dc
|
|
@ -38,7 +38,12 @@ class CredentialsOverwritesClass {
|
|||
}
|
||||
|
||||
const returnData = JSON.parse(JSON.stringify(data));
|
||||
Object.assign(returnData, overwrites);
|
||||
// Overwrite only if there is currently no data set
|
||||
for (const key of Object.keys(overwrites)) {
|
||||
if ([null, undefined, ''].includes(returnData[key])) {
|
||||
returnData[key] = overwrites[key];
|
||||
}
|
||||
}
|
||||
|
||||
return returnData;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user