a9ac821e24b49407dfd64b03fb6e00338732f0ac
aamp
  Wed Jun 8 00:53:49 2011 -0700
bugfix for microarray tracks with no default grouping e.g. rinnSex (mm7/mm8)
diff --git src/hg/hgTracks/expRatioTracks.c src/hg/hgTracks/expRatioTracks.c
index 798420a..24e0b8d 100644
--- src/hg/hgTracks/expRatioTracks.c
+++ src/hg/hgTracks/expRatioTracks.c
@@ -516,30 +516,32 @@
     slSort(&tg->items,lfsSortByName);
     }
 bedFreeList(&bedList);
 }
 
 static void lfsFromBedAndGrouping(struct track *tg, struct maGrouping *combineGroup, struct maGrouping *subset, int subsetOffset)
 /* This is sort of a replacement of msBedGroupByIndex. */
 /* It's meant to be the default microarray track filter */
 /* for tracks using the new microarrayGroups.ra scheme. */
 {
 struct linkedFeaturesSeries *lfsList = NULL;
 struct bed *bedList = tg->items;
 int i;
 int numRows;
 char newLongLabel[512];
+if (!combineGroup)
+    errAbort("Error: somehow there is no grouping select for the %s track", tg->track);
 if (bedList && (bedList->expCount != combineGroup->size))
     errAbort("Error: %s grouping has bad size (%d).  Expected %d", combineGroup->name, combineGroup->size, bedList->expCount);
 maBedClumpGivenGrouping(bedList, combineGroup, subset, subsetOffset);
 numRows = combineGroup->numGroups;
 /* Initialize the lfs array first. */
 for (i = 0; i < numRows; i++)
     {
     struct linkedFeaturesSeries *lfs;
     struct bed *bed;
     char customName[16];
     safef(customName, sizeof(customName), "Array %d", i+1);
     AllocVar(lfs);
     if (combineGroup == NULL)
 	lfs->name = cloneString(customName);
     else