Fix referrer lookup.

pull/1864/head
Mike Cao 2023-04-02 22:41:24 -07:00
parent ba71f5cafc
commit ae772f048c
1 changed files with 1 additions and 1 deletions

View File

@ -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);