b2ad359435d6780d389edcf3029cf70b67c5f27a
braney
  Mon Feb 25 15:24:16 2019 -0800
don't crash, but do abort, if a subtrack of a composite doesn't have a type #22541

diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c
index c293720..d3aa721 100644
--- src/hg/hgTracks/simpleTracks.c
+++ src/hg/hgTracks/simpleTracks.c
@@ -14233,38 +14233,38 @@
 /* add handlers for wildcard */
 if (startsWith("peptideAtlas", track->track))
     peptideAtlasMethods(track);
 else if (startsWith("gtexGene", track->track))
     gtexGeneMethods(track);
 #endif /* GBROWSE */
 }
 
 static void compositeLoad(struct track *track)
 /* Load all subtracks */
 {
 struct track *subtrack;
 long thisTime = 0, lastTime = 0;
 for (subtrack = track->subtracks; subtrack != NULL; subtrack = subtrack->next)
     {
+    if (!subtrack->loadItems) // This could happen if track type has no handler (eg, for new types or mnissing a type s)
+        errAbort("Error: No loadItems() handler for subtrack (%s) of composite track (%s) (was a type specified for this track?)\n", subtrack->track, track->track);
     if (isSubtrackVisible(subtrack) &&
 	( limitedVisFromComposite(subtrack) != tvHide))
 	{
 	if (!subtrack->parallelLoading)
 	    {
 	    lastTime = clock1000();
-	    if (!subtrack->loadItems) // This could happen if track type has no handler (eg, for new types)
-		errAbort("Error: No loadItems() handler for subtrack (%s) of composite track (%s) (is this a new track 'type'?)\n", subtrack->track, track->track);
 	    checkIfWiggling(cart, subtrack);
 	    subtrack->loadItems(subtrack);
 	    if (measureTiming)
 		{
 		thisTime = clock1000();
 		subtrack->loadTime = thisTime - lastTime;
 		lastTime = thisTime;
 		}
 	    }
 	}
     else
 	{
 	subtrack->limitedVis = tvHide;
 	subtrack->limitedVisSet = TRUE;
 	}