b01d5174ece9550fedb7b9c97bc94beb447f8342
kate
  Tue Aug 29 19:07:28 2017 -0700
Seg fault protection.

diff --git src/hg/hgTracks/barChartTrack.c src/hg/hgTracks/barChartTrack.c
index 783ec69..83c6ca7 100644
--- src/hg/hgTracks/barChartTrack.c
+++ src/hg/hgTracks/barChartTrack.c
@@ -722,31 +722,31 @@
     // for visibility, set larger than the usual squish, which is half font height
     heightPer = barChartSquishItemHeight() * 2;  // the squish packer halves this
     lineHeight=heightPer+1;
     }
 else if ((vis == tvPack) || (vis == tvFull))
     {
     heightPer = tl.fontHeight;
     lineHeight=heightPer;
     }
 
 height = tgFixedTotalHeightOptionalOverflow(tg, vis, lineHeight, heightPer, FALSE);
 
 if ((vis == tvPack) || (vis == tvFull))
     {
     // set variable height rows
-    if (tg->ss->rowCount != 0)
+    if (tg->ss && tg->ss->rowCount)
         {
         if (!tg->ss->rowSizes)
 	    {
 	    // collect the rowSizes data across all windows
 	    assert(currentWindow==windows); // first window
 	    assert(tg->ss->vis == vis); // viz matches, we have the right one
 	    struct spaceSaver *ssHold; 
 	    AllocVar(ssHold);
 	    struct track *tgSave = tg;
 	    for(tg=tgSave; tg; tg=tg->nextWindow)
 		{
 		assert(tgSave->ss->vis == tg->ss->vis); // viz matches, we have the right one
 		spaceSaverSetRowHeights(tg->ss, ssHold, getBarChartHeight);
 		}
 	    // share the rowSizes data across all windows