43dd7aadf23ac03134a46c923e6057e338053275
braney
  Sat Sep 5 09:06:08 2015 -0700
oops... bug fix for #6551 and existing sessions

diff --git src/hg/lib/cart.c src/hg/lib/cart.c
index 860db76..e95dfe8 100644
--- src/hg/lib/cart.c
+++ src/hg/lib/cart.c
@@ -653,31 +653,31 @@
 cartRemove(cart, hgHubDoDisconnect);
 }
 
 static void hideIfNotInCart(struct cart *cart, char *track)
 /* If this track is not mentioned in the cart, set it to hide */
 {
 if (cartOptionalString(cart, track) == NULL)
     cartSetString(cart, track, "hide");
 }
 
 void cartHideDefaultTracks(struct cart *cart)
 /* Hide all the tracks who have default visibilities in trackDb
  * that are something other than hide.  Do this only if the
  * variable CART_HAS_DEFAULT_VISIBILITY is set in the cart.  */
 {
-char *defaultString = cartString(cart, CART_HAS_DEFAULT_VISIBILITY);
+char *defaultString = cartOptionalString(cart, CART_HAS_DEFAULT_VISIBILITY);
 boolean cartHasDefaults = (defaultString != NULL) && sameString(defaultString, "on");
 
 if (!cartHasDefaults)
     return;
 
 char *db = cartString(cart, "db");
 struct trackDb *tdb = hTrackDb(db);
 for(; tdb; tdb = tdb->next)
     {
     struct trackDb *parent = tdb->parent;
     if (parent && parent->isShow)
         hideIfNotInCart(cart, parent->track);
     if (tdb->visibility != tvHide)
         hideIfNotInCart(cart, tdb->track);
     }