diff --git a/pages/api/send.ts b/pages/api/send.ts index 232e631d..05901f92 100644 --- a/pages/api/send.ts +++ b/pages/api/send.ts @@ -117,7 +117,7 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => { urlPath = '/'; } - if (referrerPath.startsWith('http')) { + if (referrerPath?.startsWith('http')) { const refUrl = new URL(referrer); referrerPath = refUrl.pathname; referrerQuery = refUrl.search.substring(1);