Skip to content

Commit 1138793

Browse files
committed
Re-add recursion to hasAttachmentsComposition
1 parent 3b1d0a6 commit 1138793

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/csn-runtime-extension.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Object.defineProperty(cds.builtin.classes.entity.prototype, '_attachments', {
66
const entity = this;
77
return {
88
get hasAttachmentsComposition() {
9-
return entity.compositions && Object.keys(entity.compositions).some(ele => entity.compositions[ele]._target?.["@_is_media_data"] || entity.compositions[ele]._target?._attachments.hasAttachmentsComposition)
9+
if (!entity.compositions) return false
10+
return entity.compositions && Object.keys(entity.compositions).some(ele => entity.compositions[ele]._target?.["@_is_media_data"] || entity.compositions[ele]._target?._attachments?.hasAttachmentsComposition)
1011
},
1112
get attachmentCompositions() {
1213
const resultSet = new LinkedDefinitions()

0 commit comments

Comments
 (0)