Skip to content

Commit

Permalink
Merge pull request #28881 from Expensify/vit-fixPaymentMethod
Browse files Browse the repository at this point in the history
[NoQA] Access the paymentType of report action safely
  • Loading branch information
chiragsalian authored Oct 4, 2023
2 parents 112fd2b + b8ca135 commit bdcfe3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1550,7 +1550,7 @@ function getReportPreviewMessage(report, reportAction = {}, shouldConsiderReceip
// A settled report preview message can come in three formats "paid ... elsewhere" or "paid ... with Expensify"
let translatePhraseKey = 'iou.paidElsewhereWithAmount';
if (
_.contains([CONST.IOU.PAYMENT_TYPE.VBBA, CONST.IOU.PAYMENT_TYPE.EXPENSIFY], reportAction.originalMessage.paymentType) ||
_.contains([CONST.IOU.PAYMENT_TYPE.VBBA, CONST.IOU.PAYMENT_TYPE.EXPENSIFY], lodashGet(reportAction, 'originalMessage.paymentType')) ||
reportActionMessage.match(/ (with Expensify|using Expensify)$/)
) {
translatePhraseKey = 'iou.paidWithExpensifyWithAmount';
Expand Down

0 comments on commit bdcfe3b

Please sign in to comment.