diff --git a/src/routes/post/[slug]/+page.ts b/src/routes/post/[slug]/+page.ts index a974f60..151f390 100644 --- a/src/routes/post/[slug]/+page.ts +++ b/src/routes/post/[slug]/+page.ts @@ -16,13 +16,13 @@ export const load: PageLoad = async ({ params }) => { prevTitle?: string, nextSlug?: string, nextTitle?: string, - }[] = await Promise.all(post.metadata.series.map(async (series: string) => { + }[] = await Promise.all((metadata.series || []).map(async (series: string) => { const postInSeries: Post[] = await getPosts({ series }); - let prevSlug = null; - let prevTitle = null; - let nextSlug = null; - let nextTitle = null; + let prevSlug = undefined; + let prevTitle = undefined; + let nextSlug = undefined; + let nextTitle = undefined; for (const p of postInSeries) { if (p.date > metadata.date) {