Skip to content

Commit

Permalink
pkp/pkp-lib#10626 Add safety checks when displaying review rounds
Browse files Browse the repository at this point in the history
  • Loading branch information
taslangraham committed Nov 28, 2024
1 parent 14c7d53 commit f517afc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export const WorkflowConfig = {
props: {
submission: submission,
stageId: pkp.const.WORKFLOW_STAGE_ID_EXTERNAL_REVIEW,
reviewRoundId: selectedReviewRound.id,
reviewRoundId: selectedReviewRound?.id,
},
});
}
Expand Down Expand Up @@ -298,7 +298,11 @@ export const WorkflowConfig = {
);

// if review stage has not started show no items
if (selectedReviewRound.round < currentReviewRound.round) {
if (
!selectedReviewRound ||
!currentReviewRound ||
selectedReviewRound.round < currentReviewRound.round
) {
return [];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export const WorkflowConfig = {
props: {
submission: submission,
stageId: pkp.const.WORKFLOW_STAGE_ID_INTERNAL_REVIEW,
reviewRoundId: selectedReviewRound.id,
reviewRoundId: selectedReviewRound?.id,
},
});
}
Expand All @@ -218,7 +218,11 @@ export const WorkflowConfig = {
);

// if review stage has not started show no items
if (selectedReviewRound.round < currentReviewRound.round) {
if (
!selectedReviewRound ||
!currentReviewRound ||
selectedReviewRound.round < currentReviewRound.round
) {
return [];
}

Expand Down

0 comments on commit f517afc

Please sign in to comment.