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 }