4d7b22546a7eee42f93719f2cfda6fbe0c853807
braney
  Wed Aug 31 13:48:03 2022 -0700
ignore blocks with no sequence

diff --git src/hg/ratStuff/mafCounts/mafCounts.c src/hg/ratStuff/mafCounts/mafCounts.c
index ff991b6..3253214 100644
--- src/hg/ratStuff/mafCounts/mafCounts.c
+++ src/hg/ratStuff/mafCounts/mafCounts.c
@@ -93,30 +93,33 @@
             bigWigValsOnChromFetchData(scaleVals, chrom, scaleBbi);
             values = scaleVals->valBuf;
             lastChrom = cloneString(chrom);
             }
         }
     // keep track of where this block ends
     last = blockStart + seqLen;
     int ii;
 
     // for each maf block we reset the counts of each type of nucleotide to zero
     memset(counts, 0, NUMBER_OF_NUCS * ourBufSize * sizeof(unsigned));
 
     // now go through each component of the maf block and count the nucs
     for(; comp; comp = comp->next)
         {
+        if (comp->text == NULL)
+            continue;
+
         char *str = comp->text;
         char *end = &str[seqLen];
 
         for(ii=0; str < end; str++, ii++)
             {
             unsigned char nucToIndex = letterBox[tolower(*str)];
             if (nucToIndex > 0)
                 counts[(nucToIndex - 1) * ourBufSize + ii]++;
             }
         }
 
     // now we normalize and scale if asked.
     char *str = maf->components->text;
     unsigned scaleOffset = 0;
     for(ii = 0; ii < seqLen; ii++, str++)