diff --git a/webchat/src/ip-tracker.ts b/webchat/src/ip-tracker.ts index e0dc8d11a6..dcac563a74 100644 --- a/webchat/src/ip-tracker.ts +++ b/webchat/src/ip-tracker.ts @@ -19,7 +19,12 @@ import { API_KEY } from '../private/secret'; const url = `https://ipfind.co/me?auth=${API_KEY}`; // Free Tier is 100 requests/day export const getUserIp = async (): Promise => { - const response = await fetch(url); - const responseBody = await response.json(); - return responseBody.ip_address; + try { + const response = await fetch(url); + const responseBody = await response.json(); + return responseBody.ip_address; + } catch (error) { + console.error(error); + return '0.0.0.0'; + } };