diff --git a/packages/loot-core/src/server/accounts/sync.ts b/packages/loot-core/src/server/accounts/sync.ts index ae04efa675819f0b7ffe1024caa93da7df61173e..fa6d3134057bb8516ec30fce3ddc3dba1bb17dd3 100644 --- a/packages/loot-core/src/server/accounts/sync.ts +++ b/packages/loot-core/src/server/accounts/sync.ts @@ -309,14 +309,15 @@ async function normalizeGoCardlessTransactions(transactions, acctId) { // that it matters whether the amount is a positive or negative zero. if (trans.amount > 0 || Object.is(Number(trans.amount), 0)) { const nameParts = []; - nameParts.push( - title( - trans.debtorName || - trans.remittanceInformationUnstructured || - (trans.remittanceInformationUnstructuredArray || []).join(', ') || - trans.additionalInformation, - ), - ); + const name = + trans.debtorName || + trans.remittanceInformationUnstructured || + (trans.remittanceInformationUnstructuredArray || []).join(', ') || + trans.additionalInformation; + + if (name) { + nameParts.push(title(name)); + } if (trans.debtorAccount && trans.debtorAccount.iban) { nameParts.push( '(' + @@ -329,14 +330,15 @@ async function normalizeGoCardlessTransactions(transactions, acctId) { payee_name = nameParts.join(' '); } else { const nameParts = []; - nameParts.push( - title( - trans.creditorName || - trans.remittanceInformationUnstructured || - (trans.remittanceInformationUnstructuredArray || []).join(', ') || - trans.additionalInformation, - ), - ); + const name = + trans.creditorName || + trans.remittanceInformationUnstructured || + (trans.remittanceInformationUnstructuredArray || []).join(', ') || + trans.additionalInformation; + + if (name) { + nameParts.push(title(name)); + } if (trans.creditorAccount && trans.creditorAccount.iban) { nameParts.push( '(' + diff --git a/upcoming-release-notes/2238.md b/upcoming-release-notes/2238.md new file mode 100644 index 0000000000000000000000000000000000000000..a38296a0bc269fd36e62a037866672a05b82e946 --- /dev/null +++ b/upcoming-release-notes/2238.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [MatissJanis] +--- + +GoCardless: fix sync not working if `additionalInformation` fallback field is null