Skip to content

Commit

Permalink
Fix getVar() value null bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Folyd committed Feb 14, 2024
1 parent 361b0ce commit 74cb13a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extension/script/add-search-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
function getVar(name) {
// https://github.com/rust-lang/rust/pull/113094 has change the way to get meta variable.
const el = document.querySelector("head > meta[name='rustdoc-vars']") || document.getElementById("rustdoc-vars");
return el ? el.attributes["data-" + name].value : null;
return el ? el.attributes["data-" + name]?.value : null;
}

function resourcePath(basename, extension) {
Expand Down

0 comments on commit 74cb13a

Please sign in to comment.