Safer check of base index for search

This commit is contained in:
Dustin Brett
2023-07-04 20:39:13 -07:00
parent 54691e2064
commit 34a63571af

View File

@@ -20,7 +20,7 @@ const search = async (
index?: Index
): Promise<Index.Result[]> => {
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 {