From 34a63571afcda6931e9a2107d0fb9645e68d23a1 Mon Sep 17 00:00:00 2001 From: Dustin Brett Date: Tue, 4 Jul 2023 20:39:13 -0700 Subject: [PATCH] Safer check of base index for search --- utils/search.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/search.ts b/utils/search.ts index fbd376db..f198987d 100644 --- a/utils/search.ts +++ b/utils/search.ts @@ -20,7 +20,7 @@ const search = async ( index?: Index ): Promise => { if (!window.lunr) await loadFiles(SEARCH_LIBS); - if (!index && !baseIndex.search) { + if (!index && !baseIndex?.search) { const response = await fetch(FILE_INDEX, HIGH_PRIORITY_REQUEST); try {