diff --git a/js/menu.js b/js/menu.js index 72a3cb4b..a623c543 100644 --- a/js/menu.js +++ b/js/menu.js @@ -573,6 +573,7 @@ Menu.prototype.togglePinEntry = function (id) { }; Menu.prototype.selectPin = function (num) { + if (num >= this.$pinList.children.length) return; document.location = this.$pinList.children[num].children[0].href; }; diff --git a/test/baselines/generated-reference/assets-inline.html b/test/baselines/generated-reference/assets-inline.html index fb946378..56803778 100644 --- a/test/baselines/generated-reference/assets-inline.html +++ b/test/baselines/generated-reference/assets-inline.html @@ -657,6 +657,7 @@ }; Menu.prototype.selectPin = function (num) { + if (num >= this.$pinList.children.length) return; document.location = this.$pinList.children[num].children[0].href; };