TypeError: Cannot read properties of null (reading 'parentNode') in ExtJs 5

45 views Asked by At

I'm facing a problem where some users (approximately 10) encounter crashes on the authorization page with the errors.

The main problem is the rare reproducibility without depending on browser or OS

  1. Subscribe to download the document, after calling the script
  2. Put the script not in the head, but at the end of the body
  3. Add additional check for null
  4. Try to load requests asynchronously
  5. Change the processing of the element that gives null
  6. at Function.fromElement (ext-all.js:22:470306)
    at E.onGlobalFocus (ext-all.js:22:173484)
    at E.fire (ext-all.js:22:136933)
    at E.doFireEvent (ext-all.js:22:143046) at a.doFireEvent (ext-all.js:22:403297) 
    at E.fireEventArgs (ext-all.js:22:142657)
    at E.fireEvent (ext-all.js:22:142386)
    at E.processFocusIn (ext-all.js:22:225310) at E.doDelegatedEvent (ext-all.js:22:224806)
    at E.onDelegatedEvent (ext-all.js:22:214961)```
    
  7. at Function.getCommonAncestor (ext-all.js:22:243361)
    at E.processFocusIn (ext-all.js:22:224934) at E.doDelegatedEvent (ext-all.js:22:224737) 
    at E.onDelegatedEvent (ext-all.js:22:214961)
    at r (ext-all.js:22:55389)```
    
    

The problem occurs in the fromElement function at the stage of assigning b = document.body.parentNode because it says that it is null.

    var g = Ext.Component.componentIdAttribute, 
    h = Ext-getDom(d), 
    a = Ext.ComponentManager.all, 
    e, c;
    if (b) {
        b = Ext.getDom(b);
    } else {
        b = document.body.parentNode; // Error occurs here
    }
    while (h && h.nodeType === 1 && h !== b) {
        e = h.getAttribute(g) || h.id;
        if (e) {
            c = a[e];
            if (c) {
                return c;
            }
        }
        h = h.parentNode;
    }
    return null;
},```

0

There are 0 answers