fix post?.

This commit is contained in:
tangly1024.com
2023-07-11 18:28:16 +08:00
parent 47b3fa28e9
commit bb6b2b3e1d
10 changed files with 14 additions and 18 deletions

View File

@@ -20,7 +20,7 @@ const BlogPostListScroll = ({ posts = [], currentSearch }) => {
const searchKey = getSearchKey()
if (searchKey) {
filteredPosts = posts.filter(post => {
const tagContent = post.tags ? post.tags.join(' ') : ''
const tagContent = post?.tags ? post?.tags.join(' ') : ''
const searchContent = post.title + post.summary + tagContent
return searchContent.toLowerCase().includes(searchKey.toLowerCase())
})