Index: misc/autocomplete.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/autocomplete.js,v
retrieving revision 1.33
diff -u -p -r1.33 autocomplete.js
--- misc/autocomplete.js	31 Aug 2009 05:51:07 -0000	1.33
+++ misc/autocomplete.js	5 Sep 2009 09:32:14 -0000
@@ -256,7 +256,8 @@ Drupal.ACDB.prototype.search = function 
 
   // See if this string needs to be searched for anyway.
   searchString = searchString.replace(/^\s+|\s+$/, '');
-  if (searchString.charAt(searchString.length - 1) == ',') {
+  if (searchString.length <= 0 ||
+    searchString.charAt(searchString.length - 1) == ',') {
     return;
   }
 
