From d47f30a53aa518b73f92c39fab99498ffd788ed5 Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Wed, 25 Mar 2026 12:48:34 +0100 Subject: [PATCH] fixed null pointer --- frontend/src/pages/posts/[slug].astro | 36 +++++++++++---------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/frontend/src/pages/posts/[slug].astro b/frontend/src/pages/posts/[slug].astro index 3e2a69e..63ccf3c 100644 --- a/frontend/src/pages/posts/[slug].astro +++ b/frontend/src/pages/posts/[slug].astro @@ -31,6 +31,7 @@ try { } function formatSlug(slug: string) { + if (!slug) return ''; return slug .split('-') .map(word => word.charAt(0).toUpperCase() + word.slice(1)) @@ -46,9 +47,19 @@ function formatSlug(slug: string) { Back to list {post && ( -

- {formatSlug(post.slug)} -

+
+

+ {formatSlug(post.slug)} +

+ +
)} @@ -73,22 +84,3 @@ function formatSlug(slug: string) { } -1.5-5.5Z"/> - Edit - - - )} - - - {error && ( -
-

{error}

- Return home -
- )} - - {post && ( -
- )} - -