From b23ec4bafe188dc584ebd2b674566d429198ae09 Mon Sep 17 00:00:00 2001 From: Niklas Baumstark Date: Wed, 25 Jan 2012 17:36:31 +0100 Subject: fix small bug with selected item --- fuzzyMode.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fuzzyMode.js b/fuzzyMode.js index 8c71107b..29268505 100644 --- a/fuzzyMode.js +++ b/fuzzyMode.js @@ -84,7 +84,8 @@ var fuzzyMode = (function() { }, updateSelection: function() { - this.selection = Math.min(this.selection, this.completions.length - 1) + if (this.completions.length > 0) + this.selection = Math.min(this.selection, this.completions.length - 1); for (var i = 0; i < this.completionList.children.length; ++i) this.completionList.children[i].className = (i == this.selection) ? 'selected' : ''; }, -- cgit v1.2.3