Skip to content

Commit 3d59ea3

Browse files
authored
Merge pull request DSpace#6007 from tinsch/fix-duplicates-section-undefined-error
fix undefined error when duplicates section is not present for workspace item
2 parents e8d546e + 1af4c85 commit 3d59ea3

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)