mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
Fix 500 when a product is not found (#880)
This commit is contained in:
committed by
GitHub
parent
90aa798891
commit
d09aff1745
@@ -34,7 +34,9 @@ export async function getStaticProps({
|
||||
const { products: relatedProducts } = await allProductsPromise
|
||||
|
||||
if (!product) {
|
||||
throw new Error(`Product with slug '${params!.slug}' not found`)
|
||||
return {
|
||||
notFound: true,
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
Reference in New Issue
Block a user