From 2bb6e3861b4837604d09eeebcf82570dd93f3c88 Mon Sep 17 00:00:00 2001 From: renatodellosso Date: Sun, 29 Dec 2024 21:46:51 -0500 Subject: [PATCH] Handle undefined API URL in ClientApi by providing a default empty string --- lib/api/ClientApi.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/api/ClientApi.ts b/lib/api/ClientApi.ts index 3a334d9e..fe92f229 100644 --- a/lib/api/ClientApi.ts +++ b/lib/api/ClientApi.ts @@ -47,7 +47,7 @@ import { RequestHelper } from "unified-api"; import { createNextRoute, NextApiTemplate } from "unified-api-nextjs"; const requestHelper = new RequestHelper( - process.env.NEXT_PUBLIC_API_URL, + process.env.NEXT_PUBLIC_API_URL ?? "", // Replace undefined when env is not present (ex: for testing builds) (url) => toast.error( `Unauthorized API request: ${url}. If this is an error, please contact the developers.`,