Skip to content

Commit 9eb79c1

Browse files
authored
fix(templates): website template error inside the populateAuthors hook (#8972)
1 parent 4246b36 commit 9eb79c1

File tree

2 files changed

+502
-1
lines changed

2 files changed

+502
-1
lines changed

templates/website/src/collections/Posts/hooks/populateAuthors.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ export const populateAuthors: CollectionAfterReadHook = async ({ doc, req, req:
1717
req,
1818
})
1919

20-
authorDocs.push(authorDoc)
20+
if (authorDoc) {
21+
authorDocs.push(authorDoc)
22+
}
2123
}
2224

2325
doc.populatedAuthors = authorDocs.map((authorDoc) => ({

0 commit comments

Comments
 (0)