098b0567c51ecc6e2098f17d8fbcf9dcf4f830ca
angie
  Tue Nov 13 12:25:19 2012 -0800
Problem: when we have a BAM or VCF track with per-chromosome files,and then view a chromosome for which there is no file (e.g. a random
or hap), hgTracks was hitting an early errAbort that is more appropriate
for a single-big-file track that is missing its filename. Fix: allow
bbiNameFromTableChrom to return NULL if there is a seqName column and
there simply isn't a file for that seqName.

diff --git src/lib/linefile.c src/lib/linefile.c
index 48dd049..fda30d8 100644
--- src/lib/linefile.c
+++ src/lib/linefile.c
@@ -209,30 +209,32 @@
 
 #if (defined USE_SAMTABIX || (defined USE_TABIX && !defined KNETFILE_HOOKS))
 // UCSC aliases for backwards compatibility with independently patched & linked samtools and tabix:
 #define ti_bgzf_tell bgzf_tell
 #define ti_bgzf_read bgzf_read
 #endif
 
 struct lineFile *lineFileTabixMayOpen(char *fileOrUrl, bool zTerm)
 /* Wrap a line file around a data file that has been compressed and indexed
  * by the tabix command line program.  The index file <fileOrUrl>.tbi must be
  * readable in addition to fileOrUrl. If there's a problem, warn & return NULL.
  * This works only if kent/src has been compiled with USE_TABIX=1 and linked
  * with the tabix C library. */
 {
 #ifdef USE_TABIX
+if (fileOrUrl == NULL)
+    errAbort("lineFileTabixMayOpen: fileOrUrl is NULL");
 int tbiNameSize = strlen(fileOrUrl) + strlen(".tbi") + 1;
 char *tbiName = needMem(tbiNameSize);
 safef(tbiName, tbiNameSize, "%s.tbi", fileOrUrl);
 tabix_t *tabix = ti_open(fileOrUrl, tbiName);
 if (tabix == NULL)
     {
     warn("Unable to open \"%s\"", fileOrUrl);
     freez(&tbiName);
     return NULL;
     }
 if ((tabix->idx = ti_index_load(tbiName)) == NULL)
     {
     warn("Unable to load tabix index from \"%s\"", tbiName);
     ti_close(tabix);
     tabix = NULL;