Skip to content

Commit

Permalink
fix: check first child existence before access
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Feb 8, 2024
1 parent 169fc6a commit 1b300b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion layers/core/app/server/plugins/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default defineNitroPlugin((nitroApp) => {
// Only use the first blockquote as the description
const firstChild = file.body.children?.[0]
const firstChildContent = firstChild?.children?.[0]?.children?.[0]?.value
if (firstChild.tag === 'blockquote' && firstChildContent) {
if (firstChild?.tag === 'blockquote' && firstChildContent) {
file.description = firstChildContent
file.body.children.shift()
} else {
Expand Down

0 comments on commit 1b300b6

Please sign in to comment.