diff --git a/src/libs/ReportActionsUtils.js b/src/libs/ReportActionsUtils.js index cb7ec4df6c2c..df55ae49faee 100644 --- a/src/libs/ReportActionsUtils.js +++ b/src/libs/ReportActionsUtils.js @@ -82,8 +82,7 @@ function getSortedReportActions(reportActions, shouldSortInDescendingOrder = fal * @returns {String} */ function getMostRecentIOURequestActionID(reportActions) { - const iouRequestActions = _.filter(reportActions, action => action.originalMessage - && action.originalMessage.type && action.originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.CREATE); + const iouRequestActions = _.filter(reportActions, action => lodashGet(action, 'originalMessage.type') === CONST.IOU.REPORT_ACTION_TYPE.CREATE); if (_.isEmpty(iouRequestActions)) { return null;