src/hg/hgGene/hgGene.c 1.115

1.115 2009/06/15 23:47:29 angie
Prevent stack dump in case of stoopid invocation (googlebots).
Index: src/hg/hgGene/hgGene.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgGene/hgGene.c,v
retrieving revision 1.114
retrieving revision 1.115
diff -b -B -U 4 -r1.114 -r1.115
--- src/hg/hgGene/hgGene.c	12 Mar 2009 21:51:26 -0000	1.114
+++ src/hg/hgGene/hgGene.c	15 Jun 2009 23:47:29 -0000	1.115
@@ -606,16 +606,23 @@
  * set up the globals and make a web page. */
 {
 struct sqlConnection *conn = NULL;
 cart = theCart;
+char *geneName = cartUsualString(cart, hggGene, NULL);
+if (isEmpty(geneName))
+    {
+    // Silly googlebots.
+    webDumpStackDisallow();
+    errAbort("Error: the hgg_gene parameter is missing from the cart and the CGI params.");
+    }
 getDbAndGenome(cart, &database, &genome, oldVars);
 
 /* if kgProtMap2 table exists, this means we are doing KG III */
 if (hTableExists(database, "kgProtMap2")) kgVersion = KG_III;
 
 conn = hAllocConn(database);
 getGenomeSettings();
-curGeneId = findGeneId(conn, cartString(cart, hggGene));
+curGeneId = findGeneId(conn, geneName);
 getGenePosition(conn);
 curGenePred = getCurGenePred(conn);
 curGeneName = getGeneName(curGeneId, conn);
 spConn = hAllocConn(UNIPROT_DB_NAME);