From 5e8a66b2d9ab4b3f0dac7766c0a2b0ad878f39d4 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 20 Sep 2021 18:20:28 +0200 Subject: [PATCH] Skip the check for the caret position if the selection is invalid --- .../install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } } -- 2.20.1