X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/22e9258db6c11e6e0b042e142836cdb21399cc7b..e9aaf1e41c5e695136d06f008c06b287da7d3eda:/src/editor/modules/documentCanvas/canvas/keyboard.js?ds=sidebyside diff --git a/src/editor/modules/documentCanvas/canvas/keyboard.js b/src/editor/modules/documentCanvas/canvas/keyboard.js index f879851..383ca18 100644 --- a/src/editor/modules/documentCanvas/canvas/keyboard.js +++ b/src/editor/modules/documentCanvas/canvas/keyboard.js @@ -183,11 +183,14 @@ handlers.push({keys: [KEYS.BACKSPACE, KEYS.DELETE], var cursor = canvas.getCursor(), position = canvas.getCursor().getPosition(), element = position.element, - node = element.wlxmlNode, + node = element ? element.wlxmlNode : null, direction = 'above', caretTo = 'end', goto; + if(!element || !node) { + return; + } if(event.which === KEYS.DELETE) { direction = 'below';