Skip to content

Commit 685da4b

Browse files
authored
Merge pull request #6104 from DSpace/backport-6007-to-dspace-8_x
[Port dspace-8_x] fix undefined error when duplicates section is not present for workspace item
2 parents b0b9612 + 93cd028 commit 685da4b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/app/submission/objects/submission-objects.effects.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ export class SubmissionObjectEffects {
101101

102102
// Duplicates will ignore mandatory and display only when "always display" is set or there is data to show
103103
if (sectionDefinition.sectionType === SectionsType.Duplicates) {
104-
enabled = (alwaysDisplayDuplicates() || isNotEmpty((action.payload.sections[sectionId] as WorkspaceitemSectionDuplicatesObject).potentialDuplicates));
104+
const duplicatesSection = action.payload.sections?.[sectionId] as WorkspaceitemSectionDuplicatesObject | undefined;
105+
enabled = (alwaysDisplayDuplicates() || isNotEmpty(duplicatesSection?.potentialDuplicates));
105106
}
106107

107108
let sectionData;

0 commit comments

Comments
 (0)