Added check for null gesture

This commit is contained in:
Mitchell McCaffrey 2020-04-21 20:03:56 +10:00
parent 96efcfd5de
commit 0e8e4a45d5

View File

@ -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([]);
}