Skip to content

Commit 4419611

Browse files
Neatoroanikethsaha
authored andcommitted
Add undefined check for postcontent in search plugin
1 parent 0e54ea1 commit 4419611

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plugins/search/search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export function search(query) {
129129
start = indexContent < 11 ? 0 : indexContent - 10
130130
end = start === 0 ? 70 : indexContent + keyword.length + 60
131131

132-
if (end > postContent.length) {
132+
if (postContent && end > postContent.length) {
133133
end = postContent.length
134134
}
135135

0 commit comments

Comments
 (0)