From 557fdae9f33fb2986f2ff047be6192eb4e0b589c Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Tue, 3 Dec 2024 16:50:26 +0000 Subject: [PATCH] chore: add null check (#12607) --- examples/with-markdoc/src/pages/index.astro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/with-markdoc/src/pages/index.astro b/examples/with-markdoc/src/pages/index.astro index 04cef4cad4ff..891b344de8cb 100644 --- a/examples/with-markdoc/src/pages/index.astro +++ b/examples/with-markdoc/src/pages/index.astro @@ -3,6 +3,9 @@ import { getEntry } from 'astro:content'; import Layout from '../layouts/Layout.astro'; const intro = await getEntry('docs', 'intro'); +if (!intro) { + return Astro.redirect('/404'); +} const { Content } = await intro.render(); ---