vercel / nextjs-subscription-payments

Clone, deploy, and fully customize a SaaS subscription application with Next.js.
https://subscription-payments.vercel.app/
MIT License
5.79k stars 1.19k forks source link

added error checks #281

Closed levos-snr closed 4 months ago

levos-snr commented 6 months ago

//ensure that these arrays are not undefined before calling the flatMap method. const intervals = Array.from(new Set(products?.flatMap(product => product?.prices?.map(price => price?.interval)))) // To prevent error(undefined (reading 'length')), !products || products.length === 0

vercel[bot] commented 6 months ago

@levos-snr is attempting to deploy a commit to the Vercel Solutions Team on Vercel.

A member of the Team first needs to authorize it.

leerob commented 4 months ago

https://github.com/vercel/nextjs-subscription-payments/pull/278