From e3cda119ced000a4726c7851e4d7d2b9518ef176 Mon Sep 17 00:00:00 2001 From: casperlamboo Date: Thu, 21 Dec 2017 11:16:49 +0100 Subject: [PATCH] throw error when object is empty --- src/utils/exportUtils.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/exportUtils.js b/src/utils/exportUtils.js index 3f8e006..cdff11b 100644 --- a/src/utils/exportUtils.js +++ b/src/utils/exportUtils.js @@ -83,6 +83,10 @@ export function generateExportMesh(state, options = {}) { exportState.objectsById[id] = exportShapeData; } + if (Object.keys(exportState.objectsById).length === 0) { + throw new Error('sketch is empty'); + } + const shapesManager = new ShapesManager({ toonShader: false }); shapesManager.update(exportState);