Skip to content

Commit 86d8dca

Browse files
committed
return of planDetail assigned null
1 parent 87021d5 commit 86d8dca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/pages/ExplorePage/MapBox.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ const MapBox = ({
2828

2929
(async () => {
3030
// fetch planDetails
31-
const planDetail: Plan = await fetchData(
31+
const planDetail: Plan | null = await fetchData(
3232
`plans/${selectedPlan._id}`,
3333
null,
3434
() => {},
3535
);
36+
if (!planDetail) return;
37+
3638
setPlanPolyline(planDetail._id, planDetail.polyline || "");
3739
})();
3840
}, [selection]);

0 commit comments

Comments
 (0)