diff --git a/system/Debug/Toolbar/Views/toolbar.js b/system/Debug/Toolbar/Views/toolbar.js index 42ac7362acd7..60cd3a879aed 100644 --- a/system/Debug/Toolbar/Views/toolbar.js +++ b/system/Debug/Toolbar/Views/toolbar.js @@ -337,6 +337,11 @@ var ciDebugBar = { const OUTER_ELEMENTS = ["HTML", "BODY", "HEAD"]; var getValidElementInner = function (node, reverse) { + // handle null node + if (node === null) { + return null; + } + // handle invalid tags if (OUTER_ELEMENTS.indexOf(node.nodeName) !== -1) { for (var i = 0; i < document.body.children.length; ++i) {