diff --git a/frontend/src/hooks/useRedraw.ts b/frontend/src/hooks/useRedraw.ts index b48ac668..1944b0d2 100644 --- a/frontend/src/hooks/useRedraw.ts +++ b/frontend/src/hooks/useRedraw.ts @@ -197,7 +197,7 @@ export const useRedrawCanvas = ({ // } // }; const drawPath = (ctx: CanvasRenderingContext2D, points: ILatLng[]) => { - if (points.length === 0 || !footprintRef.current) return; + if (points.length === 0 || !footprintRef.current || !map) return; const footprintImage = footprintRef.current; const markerSize = Math.min(map.getZoom() * 2, 20);