From d5e9aad52bd44f8265c22b9e261faa7ae52f9064 Mon Sep 17 00:00:00 2001 From: Neil Drumm Date: Tue, 9 Jan 2007 07:31:04 +0000 Subject: #107611 by Steven. Fix bug triggered by pressing enter while results are being fetched. --- misc/autocomplete.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'misc') diff --git a/misc/autocomplete.js b/misc/autocomplete.js index b0c454c77..166192891 100644 --- a/misc/autocomplete.js +++ b/misc/autocomplete.js @@ -213,12 +213,14 @@ Drupal.jsAC.prototype.found = function (matches) { } // Show popup with matches, if any - if (ul.childNodes.length > 0) { - $(this.popup).empty().append(ul).show(); - } - else { - $(this.popup).css({visibility: 'hidden'}); - this.hidePopup(); + if (this.popup) { + if (ul.childNodes.length > 0) { + $(this.popup).empty().append(ul).show(); + } + else { + $(this.popup).css({visibility: 'hidden'}); + this.hidePopup(); + } } } -- cgit v1.2.3