Bug not caught by the type-checker

This commit is contained in:
Simon Cambier
2022-11-28 21:09:46 +01:00
parent 8c48dda1c1
commit 719d95d15b

View File

@@ -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
}