src/hg/lib/hgFind.c 1.226

1.226 2010/04/01 03:12:15 markd
Fixed segv when an empty search term manages to make it to hgFind
Index: src/hg/lib/hgFind.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/hgFind.c,v
retrieving revision 1.225
retrieving revision 1.226
diff -b -B -U 4 -r1.225 -r1.226
--- src/hg/lib/hgFind.c	16 Feb 2010 21:16:53 -0000	1.225
+++ src/hg/lib/hgFind.c	1 Apr 2010 03:12:15 -0000	1.226
@@ -2500,8 +2500,9 @@
 multiTerm = (termCount > 1);
 
 for (i = 0;  i < termCount;  i++)
     {
+    trimSpaces(terms[i]);
     if (isEmpty(terms[i]))
 	continue;
     hgp = hgPositionsFind(db, terms[i], "", hgAppName, cart, multiTerm);
     if (hgp == NULL || hgp->posCount == 0)
@@ -3030,9 +3031,9 @@
 
 AllocVar(hgp);
 hgp->useAlias = FALSE;
 term = trimSpaces(term);
-if(term == 0)
+if(isEmpty(term))
     return hgp;
 
 hgp->query = cloneString(term);
 hgp->database = db;