diff --git a/xpfe/global/resources/content/menulistBindings.xml b/xpfe/global/resources/content/menulistBindings.xml index eb70e1f69ed8..6f10e36ae811 100644 --- a/xpfe/global/resources/content/menulistBindings.xml +++ b/xpfe/global/resources/content/menulistBindings.xml @@ -103,11 +103,8 @@ var curr = this.firstChild; while (curr && curr.localName != 'menupopup') curr = curr.nextSibling; - if (!curr) - return -1; - if (curr.childNodes.length <= val) - return -1; - this.selectedItem = curr.childNodes[val]; + if (curr && val < curr.childNodes.length) + this.selectedItem = curr.childNodes[val]; } return val; ]]>