From: Alexander Ebert Date: Mon, 20 Sep 2021 16:20:28 +0000 (+0200) Subject: Skip the check for the caret position if the selection is invalid X-Git-Tag: 5.4.8_dev_1~14 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5e8a66b2d9ab4b3f0dac7766c0a2b0ad878f39d4;p=GitHub%2FWoltLab%2FWCF.git Skip the check for the caret position if the selection is invalid --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js index 851735361a..61130a3b05 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js @@ -514,7 +514,7 @@ $.Redactor.prototype.WoltLabCaret = function() { // which also happens to be the last element if (this.selection.current() === this.$editor[0]) { var node = this.$editor[0].childNodes[this.selection.get().anchorOffset]; - if (node.nodeType === Node.ELEMENT_NODE && node.nodeName === 'TABLE') { + if (node && node.nodeType === Node.ELEMENT_NODE && node.nodeName === 'TABLE') { block = node; } }