Skip to content

Commit

Permalink
fix: check if report summary is null to prevent error on validation r…
Browse files Browse the repository at this point in the history
…esults page

Some reports have null entries which was throwing an error for the entire workspace and preventing anything from displaying
  • Loading branch information
tillywoodfield committed Oct 23, 2024
1 parent 6013129 commit 87a1243
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ export const getDocumentDownloadStatus = (document) => {
export const getDocumentValidationStatus = (document) => {
const { report } = document;
const { valid } = report || { valid: null };
const { error, warning, advisory } = report ? report.summary : { error: -1, warning: -1, advisory: -1 };
const { error, warning, advisory } =
report && report.summary ? report.summary : { error: -1, warning: -1, advisory: -1 };

if (document.report === null) {
return { value: "normal", caption: "N/A" };
Expand Down

0 comments on commit 87a1243

Please sign in to comment.