From: Aleksander Ɓukasz Date: Wed, 23 Apr 2014 09:59:27 +0000 (+0200) Subject: editor: handle invalid element passed to setCurrentElement better X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/dab22048b851ebbfd1cea955c4d313daf272fb3c?ds=inline;hp=-c editor: handle invalid element passed to setCurrentElement better --- dab22048b851ebbfd1cea955c4d313daf272fb3c diff --git a/src/editor/modules/documentCanvas/canvas/canvas.js b/src/editor/modules/documentCanvas/canvas/canvas.js index 5cfc015..b217d18 100644 --- a/src/editor/modules/documentCanvas/canvas/canvas.js +++ b/src/editor/modules/documentCanvas/canvas/canvas.js @@ -245,6 +245,11 @@ $.extend(Canvas.prototype, { }, setCurrentElement: function(element, params) { + if(!element) { + logger.debug('Invalid element passed to setCurrentElement: ' + element); + return; + } + if(!(element instanceof documentElement.DocumentElement)) { element = utils.findCanvasElement(element); }