Skip to content

Commit f1a9820

Browse files
authored
Only handle shortcuts if they are present on the page (#333)
1 parent 36d58eb commit f1a9820

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

assets/js/shortcuts.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ function setupShortcuts(shortcutDepth = 2) {
155155
const shortcuts = Array.from(document.querySelectorAll("#shortcuts div"));
156156
if (shortcuts.length == 0) {
157157
const shortcutsContainer = document.getElementById("shortcuts-container");
158-
shortcutsContainer.style.display = "none";
158+
if (shortcutsContainer) {
159+
shortcutsContainer.style.display = "none";
160+
}
159161
}
160162

161163
bindScroll();

0 commit comments

Comments
 (0)