Skip to content

Commit a849f62

Browse files
authored
Merge pull request #6106 from DSpace/backport-6007-to-dspace-10_x
[Port dspace-10_x] fix undefined error when duplicates section is not present for workspace item
2 parents 5aa8b2b + addcc6d commit a849f62

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
@@ -111,7 +111,8 @@ export class SubmissionObjectEffects {
111111

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

117118
let sectionData;

0 commit comments

Comments
 (0)