b88bd07c19e4224a3e1dc86356bd056f570c592f
braney
  Tue Feb 1 14:07:19 2022 -0800
fix a bug that resulted in erroneous bigBed entries being reported

diff --git src/lib/bbiRead.c src/lib/bbiRead.c
index 2c7fadc..39b9036 100644
--- src/lib/bbiRead.c
+++ src/lib/bbiRead.c
@@ -194,30 +194,31 @@
 if (!bptFileFind(bbi->chromBpt, chrom, strlen(chrom), idSize, sizeof(idSize)))
     {
     if (bbi->aliasHash)
         {
         // didn't find chrom name, but have an alias hash.  Try the aliases
         struct hashEl *hel = hashLookup(bbi->aliasHash, chrom);
 
         while(hel)
             {
             char *alias = hel->val;
             if (bptFileFind(bbi->chromBpt, alias, strlen(alias), idSize, sizeof(idSize)))
                 break;
 
             hel = hashLookupNext(hel);
             }
+        return NULL;
         }
     else
         {
         // if chrom is not found and the chrom starts with "chr", try without "chr"
         if (!startsWith("chr", chrom) || !bptFileFind(bbi->chromBpt, &chrom[3], strlen(chrom) - 3, idSize, sizeof(idSize)))
             return NULL;
         }
     }
 chromIdSizeHandleSwapped(bbi->isSwapped, idSize);
 
 return idSize;
 }
 
 struct fileOffsetSize *bbiOverlappingBlocks(struct bbiFile *bbi, struct cirTreeFile *ctf,
 	char *chrom, bits32 start, bits32 end, bits32 *retChromId)