Skip to content

Commit 1e2684e

Browse files
kesselbbackportbot[bot]
authored andcommitted
fix: use folder icon as fallback
Fallback to the folder icon when a content type is missing. Signed-off-by: Daniel Kesselberg <[email protected]> [skip ci]
1 parent e552da4 commit 1e2684e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/components/Editor/Attachments/AttachmentsList.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ export default {
202202
if (attachment.xNcHasPreview) {
203203
return generateUrl(`/core/preview?fileId=${attachment.xNcFileId}&x=100&y=100&a=0`)
204204
}
205-
return attachment.formatType ? OC.MimeType.getIconUrl(attachment.formatType) : null
205+
return attachment.formatType
206+
? OC.MimeType.getIconUrl(attachment.formatType)
207+
: OC.MimeType.getIconUrl('folder')
206208
},
207209
getBaseName(name) {
208210
return name.split('/').pop()

src/views/EditSidebar.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,9 @@ export default {
524524
if (attachment.xNcHasPreview) {
525525
return generateUrl(`/core/preview?fileId=${attachment.xNcFileId}&x=100&y=100&a=0`)
526526
}
527-
return attachment.formatType ? OC.MimeType.getIconUrl(attachment.formatType) : null
527+
return attachment.formatType
528+
? OC.MimeType.getIconUrl(attachment.formatType)
529+
: OC.MimeType.getIconUrl('folder')
528530
},
529531
acceptAttachmentsModal() {
530532
if (!this.doNotShare) {

0 commit comments

Comments
 (0)