From 719d95d15b61b97010d7173d755934b5da3f577d Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Mon, 28 Nov 2022 21:09:46 +0100 Subject: [PATCH] Bug not caught by the type-checker --- src/components/ModalVault.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ModalVault.svelte b/src/components/ModalVault.svelte index 216d540..c92bd25 100644 --- a/src/components/ModalVault.svelte +++ b/src/components/ModalVault.svelte @@ -188,7 +188,7 @@ function switchToInFileModal(): void { // Do nothing if the selectedNote is a PDF, // or if there is 0 match (e.g indexing in progress) - if (isFilePDF(selectedNote?.path) || !selectedNote?.matches.length) { + if (selectedNote && (isFilePDF(selectedNote?.path) || !selectedNote?.matches.length)) { return }