Skip to content

Commit 9c4e8a2

Browse files
committed
fix: Avoid throwing on folder previews as there are none
Signed-off-by: Julius Härtl <[email protected]>
1 parent 919b055 commit 9c4e8a2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/files/src/components/FileEntry.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ import { CancelablePromise } from 'cancelable-promise'
170170
import { debounce } from 'debounce'
171171
import { emit } from '@nextcloud/event-bus'
172172
import { extname } from 'path'
173-
import { formatFileSize, Permission } from '@nextcloud/files'
173+
import { formatFileSize, FileType, Permission } from '@nextcloud/files'
174174
import { generateUrl } from '@nextcloud/router'
175175
import { showError, showSuccess } from '@nextcloud/dialogs'
176176
import { translate } from '@nextcloud/l10n'
@@ -395,6 +395,10 @@ export default Vue.extend({
395395
return this.userConfig.crop_image_previews
396396
},
397397
previewUrl() {
398+
if (this.source.type === FileType.Folder) {
399+
return null
400+
}
401+
398402
try {
399403
const previewUrl = this.source.attributes.previewUrl
400404
|| generateUrl('/core/preview?fileId={fileid}', {

0 commit comments

Comments
 (0)