From b8ca135c193630ad9a50bce6545f9e1bd07db21c Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Thu, 5 Oct 2023 00:33:15 +0100 Subject: [PATCH] Access the paymentType of report action safely --- src/libs/ReportUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 647af48c6039..86caaa8a23a5 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -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';