9d1737001e59efe00fa76072027ea50aff9e3fd2 braney Tue Apr 7 08:30:25 2020 -0700 product function from null input diff --git src/hg/hgTracks/imageV2.c src/hg/hgTracks/imageV2.c index 1501bb2..571d3ef 100644 --- src/hg/hgTracks/imageV2.c +++ src/hg/hgTracks/imageV2.c @@ -1085,30 +1085,32 @@ // Gets the map assocated with a specific slice belonging to the imgTrack { struct imgSlice *slice = imgTrackSliceGetByType(imgTrack,type); if (slice == NULL) return NULL; return sliceGetMap(slice,FALSE); // Map could belong to image or could be slice specific } int imgTrackAddMapItem(struct imgTrack *imgTrack,char *link,char *title, int topLeftX,int topLeftY,int bottomRightX,int bottomRightY, char *id) // Will add a map item to an imgTrack's appropriate slice's map. Since a map item may span // slices, the imgTrack is in the best position to determine where to put the map item // returns count of map items added, which could be 0, 1 or more than one if item spans slices // NOTE: Precedence is given to first map item when adding items with same coordinates! { +if (imgTrack == NULL) + return 0; struct imgSlice *slice; char *imgFile = NULL; // name of file that hold the image char *neededId = NULL; // id is only added it it is NOT the trackId. if (imgTrack->tdb == NULL || differentStringNullOk(id, imgTrack->tdb->track)) neededId = id; // Trap surprising location s for map items, but only on test machines. if (hIsPrivateHost()) { int leftX, topY, rightX, bottomY; imgTrackCoordinates(imgTrack, &leftX, &topY, &rightX, &bottomY); // TODO for sideLabels=0, many track item maps are extending down 1 pixel too far. EXISTING BUG. if (topLeftY < topY || bottomRightY > (bottomY + 1)) // Ignoring problem for now by using + 1. { char * name = (imgTrack->name != NULL ? imgTrack->name