handle situation when nothing was actually unwrapped
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 19 Nov 2013 14:58:04 +0000 (15:58 +0100)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 2 Dec 2013 13:50:53 +0000 (14:50 +0100)
src/editor/modules/documentCanvas/commands.js

index 1981429..6ff1d86 100644 (file)
@@ -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));
+        }
     }
 });