966a8c19f18ac15df06580c18bb7515c6af258fd
Merge parents 8f399a0 d215717
chmalee
  Tue Jun 13 12:23:26 2023 -0700
Fixing merge conflict

diff --cc src/hg/lib/trackHub.c
index 0af7a03,d1f104d..b536e30
--- src/hg/lib/trackHub.c
+++ src/hg/lib/trackHub.c
@@@ -616,36 -615,33 +616,38 @@@
  struct hash *ra;
  while ((ra = raNextRecord(lf)) != NULL)
      {
      // allow that trackDb+hub+genome is in one single file
      if (hashFindVal(ra, "hub"))
          continue;
      if (hashFindVal(ra, "track"))
          break;
  
      char *twoBitPath = hashFindVal(ra, "twoBitPath");
      char *twoBitBptUrl = hashFindVal(ra, "twoBitBptUrl");
      char *genome, *trackDb;
      if (twoBitPath != NULL)
  	genome = addHubName(hashFindVal(ra, "genome"), hub->name);
      else
 +        {
          genome = hashFindVal(ra, "genome");
 +        char *alias = asmAliasFind(genome);
 +        if (!hDbExists(alias))
 +            errAbort("Error: non UCSC genome '%s' is defined without an associated twoBitPath. Please check the genomes.txt file stanzas", genome);
 +        }
+     if (hasWhiteSpace(genome))
+         errAbort("Bad genome name: \"%s\". Only alpha-numeric characters and \"_\" are allowed ([A-Za-z0-9_]).", genome);
      if (hub->defaultDb == NULL)
  	hub->defaultDb = genome;
      if (genome == NULL)
          badGenomeStanza(lf);
      if (hashLookup(hash, genome) != NULL)
          errAbort("Duplicate genome %s in stanza ending line %d of %s",
  		genome, lf->lineIx, lf->fileName);
      if (singleFile == NULL)
          {
          trackDb = hashFindVal(ra, "trackDb");
          if (trackDb == NULL)
              badGenomeStanza(lf);
          }
      else
          trackDb = singleFile;