6abbabb8e05b4f9bc098732786d715aee612ed3b
braney
  Thu Nov 7 15:19:50 2024 -0800
deal with hubId not found in hubStatus

diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c
index c92bc58..8156f5d 100644
--- src/hg/lib/hdb.c
+++ src/hg/lib/hdb.c
@@ -4197,31 +4197,33 @@
  * the supertrack trackDb subtrack fields are not set here (would be
  * incompatible with the returned list)
  * Returns list sorted by priority
  *	NOTE: this result is cached, do not free it !
  */
 {
 if (trackHubDatabase(db))
     return NULL;
 
 if (isHubTrack(db))
     {
     // this means the db has a hub_#_ prefix but didn't get loaded at init time
     unsigned hubId = hubIdFromTrackName(db);
     struct hubConnectStatus *status = hubFromIdNoAbort(hubId);
 
-    if (status->errorMessage)
+    if (status == NULL)
+        errAbort("Cannot set database to %s.  Hub with id %d is not found in hubStatus.\n",hubConnectSkipHubPrefix(db), hubId);
+    else if (status->errorMessage)
         errAbort("Cannot set database to %s.  Hub %s is reporting error: %s\n", hubConnectSkipHubPrefix(db), status->hubUrl, status->errorMessage);
     else
         errAbort("Cannot find genome %s in %s\n", hubConnectSkipHubPrefix(db), status->hubUrl);
     }
 
 struct trackDb *tdbList = NULL;
 
 boolean doCache = trackDbCacheOn();
 char *tdbPathString = hTrackDbPath();
 
 if (doCache)
     {
     struct slName *tableList = hTrackDbList();
 
     struct sqlConnection *conn = hAllocConn(db);