b9dd8c410acfb9a20dfb507b567a484b70a3c39b
braney
  Tue Feb 20 12:36:29 2024 -0800
check for NULL in exon mouseover code

diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c
index c83190c..b67298a 100644
--- src/hg/hgTracks/simpleTracks.c
+++ src/hg/hgTracks/simpleTracks.c
@@ -2910,31 +2910,31 @@
 		exonIntronNumber = exonIx;
                 strandChar = '+';
             }
 	    else {
 		exonIntronNumber = numExonIntrons-exonIx+1;
                 strandChar = '-';
             }
 
             // we still need to show the existing mouseover text
             char* existingText = lf->mouseOver;
             if (isEmpty(existingText))
                 existingText = lf->name;
 
             // construct a string that tells the user about the codon frame situation of this exon
             char *frameText = "";
-            if (gp->exonFrames && isExon)
+            if ((gp != NULL) && gp->exonFrames && isExon)
                 {
                 // start/end-phases are in the direction of transcription:
                 // if transcript is on + strand, the start phase is the exonFrame value, and the end phase is the next exonFrame (3' on DNA) value
                 // if transcript is on - strand, the start phase is the previous (=3' on DNA) exonFrame and the end phase is the exonFrame
                 int startPhase = gp->exonFrames[exonIx-1];
                 int endPhase = -1;
                 if (!revStrand) 
                     endPhase = gp->exonFrames[exonIx];
                 else 
                     if (exonIx>1)
                         endPhase = gp->exonFrames[exonIx-2];
 
                 if (gp->exonFrames[exonIx-1]==-1) // UTRs don't have a frame at all
                     {
                     frameText = ", untranslated region";