X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/74cbf170ee1512dcebf76952a9fb51624b61191b..36926b40a25b1df76c4474c89a51483b93d8a68c:/src/editor/modules/documentCanvas/commands.js diff --git a/src/editor/modules/documentCanvas/commands.js b/src/editor/modules/documentCanvas/commands.js index 1981429..6ff1d86 100644 --- a/src/editor/modules/documentCanvas/commands.js +++ b/src/editor/modules/documentCanvas/commands.js @@ -35,7 +35,9 @@ commands.register('unwrap-node', function(canvas) { } else if(!cursor.isSelecting()) { var nodeToUnwrap = cursor.getPosition().element.data('wlxmlNode'), parentNode = nodeToUnwrap.unwrap(); - canvas.setCurrentElement(utils.findCanvasElement(parentNode)); + if(parentNode) { + canvas.setCurrentElement(utils.findCanvasElement(parentNode)); + } } });