0602c5bd626181f95ddf0999af7bbb25201cf9f2 max Thu Apr 3 02:13:44 2014 -0700 oops forgot to check for null pointer in last commit. diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c index d56e3aa..c8703c9 100644 --- src/hg/lib/hdb.c +++ src/hg/lib/hdb.c @@ -1285,30 +1285,32 @@ path = replaceChars(fileName, "/gbdb/", newGbdbLoc); return path; } char *hReplaceGbdb(char* fileName) /* Returns a gbdb filename, potentially rewriting it according to hg.conf * If the settings gbdbLoc1 and gbdbLoc2 are found, try them in order, by * replacing /gbdb/ with the new locations. * If after the replacement of gbdbLoc1 the resulting fileName does not exist, * gbdbLoc2 is used. * This function does not guarantee that the returned filename exists. * We assume /gbdb/ does not appear somewhere inside a fileName. * Result has to be free'd. * */ { +if (fileName == NULL) + return fileName; char *path = hReplaceGbdbLocal(fileName); if (fileExists(path)) return path; // if the file did not exist, replace with gbdbLoc2 char* newGbdbLoc = cfgOption("gbdbLoc2"); if (newGbdbLoc==NULL) return path; freeMem(path); path = replaceChars(fileName, "/gbdb/", newGbdbLoc); return path; } char *hReplaceGbdbSeqDir(char *path, char *db)