fix: catch undefined article

This commit is contained in:
Ayo 2023-05-12 21:27:03 +02:00
parent 19010d2d72
commit 79279e4ab1

View file

@ -1,14 +1,12 @@
--- ---
import { ArticleData } from "@extractus/article-extractor"; import { ArticleData } from "@extractus/article-extractor";
import CSS from "./post.module.scss";
const article = Astro.props.article;
export interface Props { export interface Props {
article: ArticleData; article: ArticleData;
} }
const article = Astro.props.article;
const datePublished = const datePublished =
article.published && new Date(article.published).toDateString(); article?.published && new Date(article.published).toDateString();
--- ---
{ {