e9741cd6fb24c97bc19ce727ba804638f7d1f65a
braney
  Thu Jun 13 11:22:31 2019 -0700
fix bug that resulted in a crash if attached hubs have error messages

diff --git src/hg/hgHubConnect/hgHubConnect.c src/hg/hgHubConnect/hgHubConnect.c
index d63f9b7..76b7153 100644
--- src/hg/hgHubConnect/hgHubConnect.c
+++ src/hg/hgHubConnect/hgHubConnect.c
@@ -1527,30 +1527,33 @@
 	hubUpdateStatus( errCatch->message->string, hub);
 	}
     else
 	hubUpdateStatus(NULL, hub);
     }
 }
 
 int hubConnectStatusCmp(const void *va, const void *vb)
 /* Compare to sort based on shortLabel */
 {
 const struct hubConnectStatus *a = *((struct hubConnectStatus **)va);
 const struct hubConnectStatus *b = *((struct hubConnectStatus **)vb);
 struct trackHub *ta = a->trackHub;
 struct trackHub *tb = b->trackHub;
 
+if ((ta == NULL) || (tb == NULL))
+    return 0;
+
 return strcasecmp(tb->shortLabel, ta->shortLabel);
 }
 
 void doMiddle(struct cart *theCart)
 /* Write header and body of html page. */
 {
 cart = theCart;
 
 if(cgiIsOnWeb())
     checkForGeoMirrorRedirect(cart);
 
 if (cartVarExists(cart, hgHubDoClear))
     {
     doClearHub(cart);
     cartWebEnd();