Skip the check for the caret position if the selection is invalid
authorAlexander Ebert <ebert@woltlab.com>
Mon, 20 Sep 2021 16:20:28 +0000 (18:20 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 20 Sep 2021 16:20:28 +0000 (18:20 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js

index 851735361aa782eadbf500501ca9732e670d4a54..61130a3b050838244ca00d386a6179604a1cbf2f 100644 (file)
@@ -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;
                                        }
                                }