c6129b8ed361832272abefe52b3987026cdaba73
markd
  Thu Sep 3 18:46:45 2015 -0700
prevent NULL pointer dereference in some unusually chains (no redmine)

diff --git src/hg/hgTracks/chainTrack.c src/hg/hgTracks/chainTrack.c
index d875599..4e23083 100644
--- src/hg/hgTracks/chainTrack.c
+++ src/hg/hgTracks/chainTrack.c
@@ -198,41 +198,41 @@
 		sf->end = seqEnd+1;
 		sf->grayIx = lf->grayIx;
 		sf->qStart = 0;
 		sf->qEnd = sf->qStart + (sf->end - sf->start);
 		sf->next = lf->components;
 		lf->components = sf;
 		slSort(&lf->components, linkedFeaturesCmpStart);
 		}
 
 	    /* we know we have a least one component off right
 	     * now look for one off left
 	     */
 	    extra = (STARTSLOP < maxOverLeft) ? STARTSLOP:maxOverLeft;
 	    start = seqStart - extra; 
 	    while((extra < MAXLOOK) && (lf->start < seqStart) && 
-		(lf->components->start > seqStart))
+		(lf->components != NULL) && (lf->components->start > seqStart))
 		{
 		extra *= MULTIPLIER;
 		end = start;
 		start = end - extra;
                 if (start < 0)
                     start = 0;
 		doQuery(conn, fullName, lm,  hash, start, end, lf->extra, isSplit);
 		slSort(&lf->components, linkedFeaturesCmpStart);
 		}
-	    if ((lf->components->start > seqStart) && (lf->start < lf->components->start))
+	    if ((lf->components != NULL) && (lf->components->start > seqStart) && (lf->start < lf->components->start))
 		{
 		lmAllocVar(lm, sf);
 		sf->start = 0;
 		sf->end = 1;
 		sf->grayIx = lf->grayIx;
 		sf->qStart = lf->components->qStart;
 		sf->qEnd = sf->qStart + (sf->end - sf->start);
 		sf->next = lf->components;
 		lf->components = sf;
 		slSort(&lf->components, linkedFeaturesCmpStart);
 		}
 	    }
 	}
     }
 linkedFeaturesDraw(tg, seqStart, seqEnd, hvg, xOff, yOff, width,