mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 15:09:22 +00:00
fix(getPageContentText): add null check for postContent before accessing length property
Ensure postContent exists before checking its length property to prevent potential runtime errors when postContent is null or undefined.
This commit is contained in:
@@ -168,7 +168,7 @@ export function getPageContentText(post, pageBlockMap) {
|
||||
const postContent = post.content
|
||||
let contentTextList = []
|
||||
// 防止搜到加密文章的内容
|
||||
if (postContent.length > 0 && !post.password) {
|
||||
if (postContent && postContent.length > 0 && !post.password) {
|
||||
for (const postContentId of postContent) {
|
||||
const blockContentText = getBlockContentText(postContentId)
|
||||
if (blockContentText) {
|
||||
|
||||
Reference in New Issue
Block a user