6f2d511f5f6898ff2b48e78c8fa1dee9ac716957
braney
  Sun Feb 1 13:29:00 2026 -0800
move a line of code to prevent printing out a bad genePred  no RM

diff --git src/hg/lib/liftOver.c src/hg/lib/liftOver.c
index d8bcafa986b..08b04e4de36 100644
--- src/hg/lib/liftOver.c
+++ src/hg/lib/liftOver.c
@@ -1687,37 +1687,37 @@
 for (gp = gpList ; gp != NULL ; gp = gp->next)
     {
     // uglyf("%s %s %d %d %s\n", gp->name, gp->chrom, gp->txStart, gp->txEnd, gp->strand);
     char origStrand = gp->strand[0];
     if (preserveInput)
         {
         char *old = gp->name;
         gp->name = extendNameWithPosition(gp->name, gp->chrom, gp->txStart, gp->txEnd, TRUE);
         free(old); // genePredExtLoadAll uses cloneString to populate this
         }
     bed = genePredToBed(gp);
     error = remapBlockedBed(chainHash, bed, minMatch, minBlocks, fudgeThick,
                             multiple, db, chainTable);
     if (error)
 	{
-        gp->chrom = NULL; // this gp didn't get lifted so we want to make sure the caller can figure that out
         bedFree(&bed);
         if (unmapped)
             {
             fprintf(unmapped, "# %s\n", error);
             genePredTabOut(gp, unmapped);
             }
+        gp->chrom = NULL; // this gp didn't get lifted so we want to make sure the caller can figure that out
 	}
    else
 	{
         int exonCount = gp->exonCount;
         struct bed *bedList = bed;
         for (;  bed != NULL;  bed = bed->next)
             {
             if (bed->blockCount > exonCount)
                 errAbort("program error: need to allocate extra blocks for bed.");
             freeMem(gp->chrom);
             gp->chrom = cloneString(bed->chrom);
             int start = gp->txStart = bed->chromStart;
             gp->txEnd = bed->chromEnd;
             //gp->origStrand = gp->strand[0];
             gp->strand[0] = bed->strand[0];