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:
parent
072492982b
commit
557fdae9f3
1 changed files with 3 additions and 0 deletions
|
@ -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();
|
||||
---
|
||||
|
||||
|
|
Loading…
Reference in a new issue