13966ad7eb27525ef3a96c41648e5651f9a98a16 larrym Mon Dec 19 14:22:12 2011 -0800 make imgTrackAddMapItem tolerant of NULL id (fixes #6370) diff --git src/hg/hgTracks/imageV2.c src/hg/hgTracks/imageV2.c index ecbc7b0..ed4e298 100644 --- src/hg/hgTracks/imageV2.c +++ src/hg/hgTracks/imageV2.c @@ -981,31 +981,31 @@ 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! */ { 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 || differentString(id,imgTrack->tdb->track)) +if (imgTrack->tdb == NULL || differentStringNullOk(id, imgTrack->tdb->track)) neededId = id; int count = 0; for(slice = imgTrack->slices;slice != NULL;slice=slice->next) { if(slice->type == stButton) // Buttons don't have maps. Overlap will be ignored! continue; if(slice->parentImg != NULL) { if(imgFile == NULL) imgFile = slice->parentImg->file; //else if(differentString(imgFile,slice->parentImg->file)) // { // char * name = (imgTrack->name != NULL ? imgTrack->name : imgTrack->tdb != NULL ? imgTrack->tdb->track : imgFile); // warn("imgTrackAddMapItem(%s) called, but not all slice images are the same for this track.",name);