Skip to content

Commit

Permalink
Merge pull request #28706 from namhihi237/fix-28690-app-crash-update-…
Browse files Browse the repository at this point in the history
…date-merchant

[CP Staging] fix null coallescing logic
  • Loading branch information
mountiny authored Oct 3, 2023
2 parents fca7d5b + 665a9c2 commit 8e974b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/TransactionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function getCurrency(transaction: Transaction): string {
* Return the merchant field from the transaction, return the modifiedMerchant if present.
*/
function getMerchant(transaction: Transaction): string {
return transaction?.modifiedMerchant ?? transaction?.merchant ?? '';
return transaction?.modifiedMerchant ? transaction.modifiedMerchant : transaction?.merchant || '';
}

/**
Expand Down Expand Up @@ -255,7 +255,7 @@ function getTag(transaction: Transaction): string {
* Return the created field from the transaction, return the modifiedCreated if present.
*/
function getCreated(transaction: Transaction): string {
const created = transaction?.modifiedCreated ?? transaction?.created ?? '';
const created = transaction?.modifiedCreated ? transaction.modifiedCreated : transaction?.created || '';
const createdDate = parseISO(created);
if (isValid(createdDate)) {
return format(createdDate, CONST.DATE.FNS_FORMAT_STRING);
Expand Down

0 comments on commit 8e974b7

Please sign in to comment.