078759db423d8add1f2e0cfa82a532eb6bb6c369
max
Tue May 7 10:08:08 2013 -0700
bugfix for europmc who want to link to hgc directly
diff --git src/hg/hgc/pubs.c src/hg/hgc/pubs.c
index d97e4d7..6f64a39 100644
--- src/hg/hgc/pubs.c
+++ src/hg/hgc/pubs.c
@@ -511,30 +511,32 @@
safef(query, sizeof(query), "SHOW COLUMNS FROM %s LIKE 'seqIds';", trackTable);
char *seqIdPresent = sqlQuickString(conn, query);
if (!seqIdPresent) {
return NULL;
}
/* get sequence-Ids for feature that was clicked (item&startPos are unique) and return as hash*/
safef(query, sizeof(query), "SELECT seqIds,'' FROM %s WHERE name='%s' "
"and chrom='%s' and chromStart=%d;", trackTable, item, seqName, start);
if (pubsDebug)
printf("%s
", query);
// split comma-sep list into parts
char *seqIdCoordString = sqlQuickString(conn, query);
char *seqIdCoords[1024];
+if (isEmpty(seqIdCoordString))
+ return NULL;
int partCount = chopString(seqIdCoordString, ",", seqIdCoords, ArraySize(seqIdCoords));
int i;
struct hash *seqIdHash = NULL;
seqIdHash = newHash(0);
for (i=0; i", seqIdCoords[i]);
hashAdd(seqIdHash, seqIdCoords[i], NULL);
}
return seqIdHash;
}