From: Aleksander Ɓukasz Date: Tue, 19 Nov 2013 14:58:04 +0000 (+0100) Subject: handle situation when nothing was actually unwrapped X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/36926b40a25b1df76c4474c89a51483b93d8a68c?hp=74cbf170ee1512dcebf76952a9fb51624b61191b handle situation when nothing was actually unwrapped --- 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)); + } } });