Skip to content

Commit

Permalink
fix: Avoid throwing on folder previews as there are none
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr authored and skjnldsv committed Aug 22, 2023
1 parent 5234807 commit f4adb0d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/files/src/components/FileEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ import { CancelablePromise } from 'cancelable-promise'
import { debounce } from 'debounce'
import { emit } from '@nextcloud/event-bus'
import { extname } from 'path'
import { formatFileSize, Permission } from '@nextcloud/files'
import { formatFileSize, FileType, Permission } from '@nextcloud/files'
import { generateUrl } from '@nextcloud/router'
import { showError, showSuccess } from '@nextcloud/dialogs'
import { translate } from '@nextcloud/l10n'
Expand Down Expand Up @@ -395,6 +395,10 @@ export default Vue.extend({
return this.userConfig.crop_image_previews
},
previewUrl() {
if (this.source.type === FileType.Folder) {
return null
}

try {
const previewUrl = this.source.attributes.previewUrl
|| generateUrl('/core/preview?fileId={fileid}', {
Expand Down

0 comments on commit f4adb0d

Please sign in to comment.