Skip to content

Commit

Permalink
Fix check for creation error with null values
Browse files Browse the repository at this point in the history
  • Loading branch information
neil-marcellini committed Oct 10, 2023
1 parent 16f5326 commit 1a9ac08
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,8 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p

// If we're going to open a failed money request report, remove the report preview action in the failure data
const currentReport = ReportUtils.getReport(reportID);
if (!_.isEmpty(lodashGet(currentReport, 'errorFields.createChat')) && ReportUtils.isExpenseReport(currentReport) && currentReport.parentReportID && currentReport.parentReportActionID) {
const reportCreationErrors = _.chain(lodashGet(currentReport, 'errorFields.createChat')).compact().value();
if (ReportUtils.isExpenseReport(currentReport) && currentReport.parentReportID && currentReport.parentReportActionID && !_.isEmpty(reportCreationErrors)) {
reportFailureData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${currentReport.parentReportID}`,
Expand Down

0 comments on commit 1a9ac08

Please sign in to comment.