Add undefined check for postcontent in search plugin

This commit is contained in:
Moritz Schramm 2020-01-16 10:28:11 +01:00 committed by Anix
parent 0e54ea1177
commit 4419611238

View File

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