diff --git a/src/components/MapDrawing.js b/src/components/MapDrawing.js index ba5ed01..2387eef 100644 --- a/src/components/MapDrawing.js +++ b/src/components/MapDrawing.js @@ -95,18 +95,20 @@ function MapDrawing({ ? pointsToGesture(simplifiedPoints) : "path"; - const data = - type === "path" - ? { points: simplifiedPoints } - : gestureToData(simplifiedPoints, type); + if (type !== null) { + const data = + type === "path" + ? { points: simplifiedPoints } + : gestureToData(simplifiedPoints, type); - onShapeAdd({ - type, - data, - id: shortid.generate(), - color: brushColor, - blend: useBrushBlending, - }); + onShapeAdd({ + type, + data, + id: shortid.generate(), + color: brushColor, + blend: useBrushBlending, + }); + } setBrushPoints([]); }