From eac4ddfb43085b222463e661a983261c5bbfe7d2 Mon Sep 17 00:00:00 2001 From: Paul Kiddle <1755184+PaulKiddle@users.noreply.github.com> Date: Wed, 10 Jun 2026 19:39:14 +0100 Subject: [PATCH] Don't download file if file is not defined Fixes https://github.com/nextcloud/notes/issues/1178 Signed-off-by: Paul Kiddle <1755184+PaulKiddle@users.noreply.github.com> --- src/views/Viewer.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/views/Viewer.vue b/src/views/Viewer.vue index 53de2d4cc..a74d2a2b6 100644 --- a/src/views/Viewer.vue +++ b/src/views/Viewer.vue @@ -1239,8 +1239,13 @@ export default defineComponent({ performDownload() { logger.debug('Performing download', { file: this.currentFile }) + const path = this.currentFile.source ?? this.currentFile.davPath + if(!path) { + logger.debug('File path undefined; aborting download', { file: this.currentFile }) + return + } const a = document.createElement('a') - a.href = this.currentFile.source ?? this.currentFile.davPath + a.href = path a.download = this.currentFile.basename document.body.appendChild(a) a.click()