de3ff5d7bdfc4e7c26583b6f2f1f99689d142ca1
angie
  Fri Aug 29 12:43:13 2014 -0700
Added a missing NULL check to hTrackDbForTrackAndAncestors, which was SEGV'ing in #13776.I also noticed that it doesn't support custom tracks, but the right way to add that
functionality would be more disruptive, and there are only 4 places that call
hTrackDbForTrackAndAncestors.  So I added a comment warning to the declaration and
an error message in case I'm wrong about custom tracks not being passed into this.
refs #13776

diff --git src/hg/inc/hdb.h src/hg/inc/hdb.h
index 5437888..fbca344 100644
--- src/hg/inc/hdb.h
+++ src/hg/inc/hdb.h
@@ -505,30 +505,31 @@
 
 struct trackDb *tdbForTrack(char *db, char *track,struct trackDb **tdbList);
 /* Load trackDb object for a track. If track is composite, its subtracks
  * will also be loaded and inheritance will be handled; if track is a
  * subtrack then inheritance will be handled.  (Unless a subtrack has
  * "noInherit on"...) This will die if the current database does not have
  * a trackDb, but will return NULL if track is not found.
  * MAY pass in prepopulated trackDb list, or may receive the trackDb list as an inout. */
 #define hTrackDbForTrack(db,track) tdbForTrack(db,track,NULL)
 
 struct trackDb *hTrackDbForTrackAndAncestors(char *db, char *track);
 /* Load trackDb object for a track. If need be grab its ancestors too.
  * This does not load children. hTrackDbForTrack will handle children, and
  * is actually faster if being called on lots of tracks.  This function
  * though is faster on one or two tracks. */
+// WARNING: this works for hub and db tracks but not custom tracks.
 
 struct trackDb *hCompositeTrackDbForSubtrack(char *db, struct trackDb *sTdb);
 /* Given a trackDb that may be for a subtrack of a composite track,
  * return the trackDb for the composite track if we can find it, else NULL.
  * Note: if the composite trackDb is found and returned, then its subtracks
  * member will contain a newly allocated tdb like sTdb (but not ==). */
 
 struct hTableInfo *hFindTableInfoWithConn(struct sqlConnection *conn, char *chrom, char *rootName);
 /* Find table information, with conn as part of input parameters.  Return NULL if no table.  */
 
 struct hTableInfo *hFindTableInfo(char *db, char *chrom, char *rootName);
 /* Find table information in specified db.  Return NULL if no table. */
 
 int hTableInfoBedFieldCount(struct hTableInfo *hti);
 /* Return number of BED fields needed to save hti. */