0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

chore: add null check (#12607)

This commit is contained in:
Matt Kane 2024-12-03 16:50:26 +00:00 committed by GitHub
parent 072492982b
commit 557fdae9f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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();
---