From 75df16b937bb420e7d93a411e73f7b59578b1b7e Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Wed, 13 Jun 2012 13:41:12 -0700 Subject: fix bug #1718 (trying to delete a non-existent canvas) --- js/tools/PenTool.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'js/tools') diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js index 33ca5c71..2cffb44d 100755 --- a/js/tools/PenTool.js +++ b/js/tools/PenTool.js @@ -204,10 +204,12 @@ exports.PenTool = Montage.create(ShapeTool, { this.application.ninja.stage.clearDrawingCanvas();//stageManagerModule.stageManager.clearDrawingCanvas(); //undo/redo...go through ElementController and NJEvent - var els = []; - ElementController.removeElement(this._selectedSubpathCanvas); - els.push(this._selectedSubpathCanvas); - NJevent( "elementsRemoved", els ); + if (this._selectedSubpathCanvas) { + var els = []; + ElementController.removeElement(this._selectedSubpathCanvas); + els.push(this._selectedSubpathCanvas); + NJevent( "elementsRemoved", els ); + } this._selectedSubpathCanvas = null; } }, -- cgit v1.2.3