From 6cdb465df9dffb662402463053ad3b943b8ae079 Mon Sep 17 00:00:00 2001 From: Moritz Schramm Date: Thu, 16 Jan 2020 10:28:11 +0100 Subject: [PATCH] Add undefined check for postcontent in search plugin --- src/plugins/search/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/search/search.js b/src/plugins/search/search.js index 73dbdb2c0..9c9f4d3d5 100644 --- a/src/plugins/search/search.js +++ b/src/plugins/search/search.js @@ -129,7 +129,7 @@ export function search(query) { start = indexContent < 11 ? 0 : indexContent - 10 end = start === 0 ? 70 : indexContent + keyword.length + 60 - if (end > postContent.length) { + if (postContent && end > postContent.length) { end = postContent.length }