Skip to content

Commit

Permalink
Merge pull request #52547 from allgandalf/patch-12
Browse files Browse the repository at this point in the history
[CP Staging]: fix crash on staging due to null assertion of reports

(cherry picked from commit a07109b)

(CP triggered by mountiny)
  • Loading branch information
mountiny authored and OSBotify committed Nov 14, 2024
1 parent b2901be commit 5be8cd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6351,7 +6351,7 @@ function shouldDisplayViolationsRBRInLHN(report: OnyxEntry<Report>, transactionV
// - Belong to the same workspace
// And if any have a violation, then it should have a RBR
const allReports = Object.values(ReportConnection.getAllReports() ?? {}) as Report[];
const potentialReports = allReports.filter((r) => r.ownerAccountID === currentUserAccountID && (r.stateNum ?? 0) <= 1 && r.policyID === report.policyID);
const potentialReports = allReports.filter((r) => r?.ownerAccountID === currentUserAccountID && (r?.stateNum ?? 0) <= 1 && r?.policyID === report.policyID);
return potentialReports.some(
(potentialReport) => hasViolations(potentialReport.reportID, transactionViolations) || hasWarningTypeViolations(potentialReport.reportID, transactionViolations),
);
Expand Down

0 comments on commit 5be8cd0

Please sign in to comment.