diff --git a/xpfe/components/autocomplete/resources/content/autocomplete.xml b/xpfe/components/autocomplete/resources/content/autocomplete.xml index f6bbeac26940..f5d8f5d09551 100644 --- a/xpfe/components/autocomplete/resources/content/autocomplete.xml +++ b/xpfe/components/autocomplete/resources/content/autocomplete.xml @@ -527,7 +527,7 @@ 0 && results.defaultItemIndex != -1) - { + if (results && results.items.Count() > 0 && results.defaultItemIndex != -1) + { val = this.getSessionValueAt(name, results.defaultItemIndex); this.setTextValue(val); this.mDefaultMatchFilled = true; this.mNeedToFinish = false; break; - } + } } if (this.mNeedToFinish) { // if a search is happening at this juncture, bail out of this function // and let the search finish, and tell it to come back here when it's done - if (this.isSearching || this.isWaiting) { + if (this.isSearching) { this.mFinishAfterSearch = true; this.mFireAfterSearch = aFireTextCommand; return;