1eb157e704df43fc4f530be034e7a934475c2b0b
braney
  Fri Sep 9 11:26:06 2022 -0700
require at least one extra index of a chromAlias bigBed

diff --git src/lib/bbiAlias.c src/lib/bbiAlias.c
index d205773..7ccff95 100644
--- src/lib/bbiAlias.c
+++ src/lib/bbiAlias.c
@@ -20,30 +20,34 @@
 	{
 	struct slName *name = newSlName(bedRow[ii]);
 	slAddHead(&list, name);
 	}
     }
 
 slReverse(&list);
 return list;
 }
 
 struct bptIndex *bbiAliasOpenExtra(struct bbiFile *bbi)
 /* Open any extra indices that this bigBed has. */
 {
 struct bptIndex *bptList = NULL;
 struct slName *indexList = bigBedListExtraIndexes(bbi);
+
+if (indexList == NULL)
+    errAbort("chromAlias bigBed file %s has to have a least one extra index.", bbi->fileName);
+
 for(; indexList; indexList = indexList->next)
     {
     struct bptIndex *bptIndex;
     AllocVar(bptIndex);
     bptIndex->bpt = bigBedOpenExtraIndex(bbi, indexList->name, &bptIndex->fieldIx);
     slAddHead(&bptList, bptIndex);
     }
 
 return bptList;
 }
 
 char *bbiAliasFindNative(struct bbiFile *bbi, struct bptIndex *bptIndex, struct lm *lm, char *alias)
 /* Find the native seqName for a given alias given a bigBed. */
 {
 for(; bptIndex; bptIndex = bptIndex->next)