From 0d988e254a72226d1c1f4bf44ec614275a5ed985 Mon Sep 17 00:00:00 2001 From: hwinkr Date: Tue, 17 Oct 2023 01:32:34 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=EC=98=A4=EB=B2=84=EB=A0=88=EC=9D=B4=20?= =?UTF-8?q?=ED=81=B4=EB=9E=98=EC=8A=A4=20=EC=83=9D=EC=84=B1=EC=9E=90=20?= =?UTF-8?q?=ED=95=A8=EC=88=98=EC=9D=98=20userLocation=20=ED=83=80=EC=9E=85?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Map/handlers/overlays.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/Map/handlers/overlays.ts b/src/pages/Map/handlers/overlays.ts index 1d54445a..5d4bcdba 100644 --- a/src/pages/Map/handlers/overlays.ts +++ b/src/pages/Map/handlers/overlays.ts @@ -19,12 +19,12 @@ class CustomOverlay implements ICustomOverlay { private overlays: Record; private openModal: OpenModal; private closeModal: CloseModal; - private userLocation: Location; + private userLocation: Location | null; constructor( openModal: OpenModal, closeModal: CloseModal, - userLocation: Location, + userLocation: Location | null, ) { this.openModal = openModal; this.closeModal = closeModal; @@ -56,6 +56,7 @@ class CustomOverlay implements ICustomOverlay { const { buildingNumber, buildingName, latlng } = building; const [lat, lng] = latlng; + if (!this.userLocation) return; hasLocationPermission(this.userLocation) ? this.openModal(modals.confirm, { message: `목적지(${buildingNumber})로 길찾기를 시작할까요?`,