Skip to content

Commit a07109b

Browse files
authored
Merge pull request #52547 from allgandalf/patch-12
[CP Staging]: fix crash on staging due to null assertion of reports
2 parents 12cd1ce + 8a3352c commit a07109b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libs/ReportUtils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6351,7 +6351,7 @@ function shouldDisplayViolationsRBRInLHN(report: OnyxEntry<Report>, transactionV
63516351
// - Belong to the same workspace
63526352
// And if any have a violation, then it should have a RBR
63536353
const allReports = Object.values(ReportConnection.getAllReports() ?? {}) as Report[];
6354-
const potentialReports = allReports.filter((r) => r.ownerAccountID === currentUserAccountID && (r.stateNum ?? 0) <= 1 && r.policyID === report.policyID);
6354+
const potentialReports = allReports.filter((r) => r?.ownerAccountID === currentUserAccountID && (r?.stateNum ?? 0) <= 1 && r?.policyID === report.policyID);
63556355
return potentialReports.some(
63566356
(potentialReport) => hasViolations(potentialReport.reportID, transactionViolations) || hasWarningTypeViolations(potentialReport.reportID, transactionViolations),
63576357
);

0 commit comments

Comments
 (0)