Browse Source

Merge pull request #6171 from afshin/node-null-check

Make sure `node` exists when traversing up the DOM tree.
Ian Rose 6 years ago
parent
commit
46e04d343b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/application/src/frontend.ts

+ 1 - 1
packages/application/src/frontend.ts

@@ -133,7 +133,7 @@ export abstract class JupyterFrontEnd<
         return node;
       }
       node = node.parentNode as HTMLElement;
-    } while (node.parentNode && node !== node.parentNode);
+    } while (node && node.parentNode && node !== node.parentNode);
     return undefined;
 
     // TODO: we should be able to use .composedPath() to simplify this function