smartxml: signal that operation ended
[fnpeditor.git] / src / editor / modules / documentCanvas / canvas / canvas.js
index 5cfc015..b217d18 100644 (file)
@@ -245,6 +245,11 @@ $.extend(Canvas.prototype, {
     },
 
     setCurrentElement: function(element, params) {
     },
 
     setCurrentElement: function(element, params) {
+        if(!element) {
+            logger.debug('Invalid element passed to setCurrentElement: ' + element);
+            return;
+        }
+
         if(!(element instanceof documentElement.DocumentElement)) {
             element = utils.findCanvasElement(element);
         }
         if(!(element instanceof documentElement.DocumentElement)) {
             element = utils.findCanvasElement(element);
         }