File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
next/app/(main)/beitrag/[date]/[postslug] Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -136,15 +136,16 @@ export async function generateMetadata(
136136 parent : ResolvingMetadata
137137) : Promise < Metadata > {
138138 const post = await getPost ( params ) ;
139- // console.log("constent", post.content.content);
140139
141140 let description = post . short_description ;
142141
143- if ( ! description ) {
142+ if ( ! description && post . content && post . content . content ) {
144143 let paragraph = post . content . content . find (
145144 ( item ) => item . type === "paragraph"
146145 ) ;
147- description = paragraph . content . find ( ( item ) => item . type === "text" ) . text ;
146+ if ( paragraph && paragraph . content ) {
147+ description = paragraph . content . find ( ( item ) => item . type === "text" ) . text ;
148+ }
148149 }
149150
150151 // optionally access and extend (rather than replace) parent metadata
You can’t perform that action at this time.
0 commit comments