Skip to content

Commit ab180c2

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 f5efd2a commit ab180c2

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,8 @@ function preLoadCss(cssUrl) {
538538
return;
539539
}
540540

541-
// @ts-expect-error
542-
if (document.activeElement.tagName === "INPUT" &&
541+
if (document.activeElement &&
542+
document.activeElement.tagName === "INPUT" &&
543543
// @ts-expect-error
544544
document.activeElement.type !== "checkbox" &&
545545
// @ts-expect-error

0 commit comments

Comments
 (0)