diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index d52b50fc..2ed645d8 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -2205,13 +2205,14 @@ var mouseUp = function (evt) { // if this element is in a group, go up until we reach the top-level group // just below the layer groups // TODO: once we implement links, we also would have to check for elements - while (t.parentNode.parentNode.tagName === 'g') { + while (t && t.parentNode && t.parentNode.parentNode && t.parentNode.parentNode.tagName === 'g') { t = t.parentNode; } // if we are not in the middle of creating a path, and we've clicked on some shape, // then go to Select mode. // WebKit returns
when the canvas is clicked, Firefox/Opera return if ((currentMode !== 'path' || !drawnPath) && + t && t.parentNode && t.parentNode.id !== 'selectorParentGroup' && t.id !== 'svgcanvas' && t.id !== 'svgroot' ) {