570b4217afcf77a3435db55a2083716e8ebe61b5
ceisenhart
  Tue Jul 18 11:16:27 2017 -0700
Fix for related tables schema crashing build patch, refs #19810

diff --git src/hg/hgTables/schema.c src/hg/hgTables/schema.c
index 659a209..669c73e 100644
--- src/hg/hgTables/schema.c
+++ src/hg/hgTables/schema.c
@@ -662,31 +662,31 @@
 boolean isTabix = FALSE;
 if (isHubTrack(table))
     showSchemaHub(db, table);
 else if (isBigBed(database, table, curTrack, ctLookupName))
     showSchemaBigBed(table, tdb);
 else if (isLongTabixTable(table))
     showSchemaLongTabix(table, tdb);
 else if (isBamTable(table))
     showSchemaBam(table, tdb);
 else if (isVcfTable(table, &isTabix))
     showSchemaVcf(table, tdb, isTabix);
 else if (isCustomTrack(table))
     showSchemaCt(db, table);
 else if (sameWord(table, WIKI_TRACK_TABLE))
     showSchemaWiki(tdb, table);
-else if (startsWithWord("bigWig", tdb->type) && !hTableExists(db, table))
+else if (tdb &&startsWithWord("bigWig", tdb->type) && !hTableExists(db, table))
 	showSchemaBigWigNoTable(db, table, tdb);
 else
     showSchemaDb(db, tdb, table);
 }
 
 void doTableSchema(char *db, char *table, struct sqlConnection *conn)
 /* Show schema around table (which is not described by curTrack). */
 {
 struct trackDb *tdb = NULL;
 char parseBuf[256];
 dbOverrideFromTable(parseBuf, &db, &table);
 htmlOpen("Schema for %s", table);
 tdb = hTrackDbForTrack(database, table);
 showSchema(db, tdb, table);
 htmlClose();