Skip to content

Commit 5ff5170

Browse files
authored
fix: Prevent TypeError crash on undefined attachment info
Adds optional chaining to info.filename in AttachmentList.vue. This prevents a complete UI crash (TypeError: Cannot read properties of undefined (reading 'filename')) when rendering a card that has an attachment with missing or undefined info data. the attachment list was not getting populated on some cards Signed-off-by: aquananu <93096176+aquananu@users.noreply.github.com>
1 parent b25a50b commit 5ff5170

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/components/card/AttachmentList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export default {
195195
}
196196
},
197197
attachmentBasename() {
198-
return (attachment) => attachment?.extendedData?.info.filename
198+
return (attachment) => attachment?.extendedData?.info?.filename
199199
?? (attachment?.name ?? attachment.data).replace(/\.[^/.]+$/, '')
200200
},
201201
attachmentExtension() {

0 commit comments

Comments
 (0)