From f450fc35fb8b4ff687d85f5bb53848623fee47ee Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Tue, 25 Apr 2023 16:56:31 -0700 Subject: [PATCH] Fixed city showing undefined. --- lib/detect.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/detect.ts b/lib/detect.ts index 0d0614b1..2597739b 100644 --- a/lib/detect.ts +++ b/lib/detect.ts @@ -70,7 +70,7 @@ export async function getLocation(ip, req) { return { country, subdivision1: region, - city: decodeURIComponent(city), + city: city ? decodeURIComponent(city) : undefined, }; }