From ab180c29e36504b4faed64dbffb29fbeca71e61c Mon Sep 17 00:00:00 2001 From: binarycat Date: Mon, 10 Mar 2025 13:54:02 -0500 Subject: main.js: handle document.activeElement being null this is technically possible if someone sticks rustdoc in an iframe, i think? --- src/librustdoc/html/static/js/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index 3fdff21e591..755b999e171 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -538,8 +538,8 @@ function preLoadCss(cssUrl) { return; } - // @ts-expect-error - if (document.activeElement.tagName === "INPUT" && + if (document.activeElement && + document.activeElement.tagName === "INPUT" && // @ts-expect-error document.activeElement.type !== "checkbox" && // @ts-expect-error -- cgit 1.4.1-3-g733a5