fee89631699bd5bdfb821e27ec3cc386c98628cd
jcasper
  Sun Nov 23 21:42:45 2025 -0800
Setting a url on bed3 tracks shouldn't crash because idInUrl is undefined, no ticket

diff --git src/hg/lib/hui.c src/hg/lib/hui.c
index 013e6b2f524..56b05b693f4 100644
--- src/hg/lib/hui.c
+++ src/hg/lib/hui.c
@@ -10405,31 +10405,31 @@
 outs[0] = idInUrl;
 ins[1] = "$T";
 outs[1] = track;
 ins[2] = "$S";
 outs[2] = seqName;
 ins[3] = "$[";
 outs[3] = startString;
 ins[4] = "$]";
 outs[4] = endString;
 ins[5] = "$s";
 outs[5] = skipChr(seqName);
 ins[6] = "$D";
 outs[6] = trackHubSkipHubName(db);
 ins[7] = "$P";  /* for an item name of the form:  prefix:suffix */
 ins[8] = "$p";	/* the P is the prefix, the p is the suffix */
-if (stringIn(":", idInUrl)) {
+if (idInUrl && stringIn(":", idInUrl)) {
     char *itemClone = cloneString(idInUrl);
     char *suffix = stringIn(":", itemClone);
     char *suffixClone = cloneString(suffix+1); /* +1 skip the : */
     char *nextColon = stringIn(":", suffixClone+1);
     if (nextColon)	/* terminate suffixClone suffix */
         *nextColon = '\0';	/* when next colon is present */
     *suffix = '\0';   /* terminate itemClone prefix */
     outs[7] = itemClone;
     outs[8] = suffixClone;
     /* small memory leak here for these cloned strings */
     /* not important for a one-time operation in a CGI that will exit */
 } else {
     outs[7] = idInUrl;	/* otherwise, these are not expected */
     outs[8] = idInUrl;	/* to be used */
 }