Skip to content

Commit 38a4dbf

Browse files
committed
main.js: handle document.activeElement being null
this is technically possible if someone sticks rustdoc in an iframe, i think?
1 parent 4fc09a7 commit 38a4dbf

File tree

1 file changed

+2
-2
lines changed
  • src/librustdoc/html/static/js

1 file changed

+2
-2
lines changed

src/librustdoc/html/static/js/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,8 @@ function preLoadCss(cssUrl) {
541541
return;
542542
}
543543

544-
// @ts-expect-error
545-
if (document.activeElement.tagName === "INPUT" &&
544+
if (document.activeElement &&
545+
document.activeElement.tagName === "INPUT" &&
546546
// @ts-expect-error
547547
document.activeElement.type !== "checkbox" &&
548548
// @ts-expect-error

0 commit comments

Comments
 (0)