diff --git a/pages/search/[keyword].js b/pages/search/[keyword].js index c00b6764..8f0cf779 100644 --- a/pages/search/[keyword].js +++ b/pages/search/[keyword].js @@ -120,7 +120,10 @@ async function filterByMemCache (allPosts, keyword) { let hitCount = 0 for (const i in indexContent) { const c = indexContent[i] - const index = c.toLowerCase().indexOf(keyword.toLowerCase()) + if (!c) { + continue + } + const index = c.toLowerCase().indexOf(keyword.toLowerCase()) || -1 if (index > -1) { hit = true hitCount += 1