Skip to content

Commit

Permalink
Prevent using an existingSplitChatReport with undefined id
Browse files Browse the repository at this point in the history
  • Loading branch information
neil-marcellini committed Jul 2, 2024
1 parent dc2d0da commit a981882
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3676,7 +3676,7 @@ function trackExpense(

function getOrCreateOptimisticSplitChatReport(existingSplitChatReportID: string, participants: Participant[], participantAccountIDs: number[], currentUserAccountID: number) {
// The existing chat report could be passed as reportID or exist on the sole "participant" (in this case a report option)
const existingChatReportID = existingSplitChatReportID || participants[0].reportID;
const existingChatReportID = existingSplitChatReportID ?? participants[0].reportID ?? '';

// Check if the report is available locally if we do have one
let existingSplitChatReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${existingChatReportID}`];
Expand Down

0 comments on commit a981882

Please sign in to comment.