e68fb2c207107e2195969d52547cb7e12695e9a5 markd Mon May 4 21:29:45 2015 -0700 Generate error rather than SEGV if genomeClade is not found (no redmine) diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c index 2792ea2..ed89544 100644 --- src/hg/lib/hdb.c +++ src/hg/lib/hdb.c @@ -438,30 +438,32 @@ return genome; struct sqlConnection *conn = hConnectCentral(); char query[512]; /* Get the top-priority genome *with an active database* so if genomeClade * gets pushed from hgwdev to hgwbeta/RR with genomes whose dbs haven't been * pushed yet, they'll be ignored. */ sqlSafef(query, sizeof(query), "select g.genome from %s d,%s g " "where g.clade = '%s' and g.genome = d.genome " "and d.active = 1 " "order by g.priority limit 1", dbDbTable(), genomeCladeTable(), clade); genome = sqlQuickString(conn, query); hDisconnectCentral(&conn); +if (genome == NULL) + errAbort("No default genome for clade: %s", clade); return genome; } char *hDbForSciName(char *sciName) /* Get default db for scientific name */ { char *db = NULL; char query[256]; struct sqlConnection *centralConn = hConnectCentral(); sqlSafef(query, sizeof(query), "select f.name from %s d,%s f " "where d.scientificName='%s' " "and d.name = f.name ", dbDbTable(), defaultDbTable(), sciName); db = sqlQuickString(centralConn, query);