Ticket #9809: dom_node.patch

File dom_node.patch, 641 bytes (added by Alex Lee, 11 years ago)

Try/catch block to stop parent lookup

  • core/dom/node.js

    diff --git a/core/dom/node.js b/core/dom/node.js
    index 6702609..ba22a1e 100644
    a b CKEDITOR.tools.extend( CKEDITOR.dom.node.prototype, { 
    441441         * @returns {CKEDITOR.dom.element} The parent element.
    442442         */
    443443        getParent: function( allowFragmentParent ) {
    444                 var parent = this.$.parentNode;
     444                var parent;
     445                try {
     446                        parent = this.$.parentNode;
     447                }
     448                catch( e ) {
     449                        parent = null;
     450                }
    445451                return ( parent && ( parent.nodeType == CKEDITOR.NODE_ELEMENT || allowFragmentParent && parent.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT ) ) ? new CKEDITOR.dom.node( parent ) : null;
    446452        },
    447453
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy