hungio / route-me

Automatically exported from code.google.com/p/route-me
0 stars 0 forks source link

Bug in RMMarkerManager #155

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Replace RMMarkerManager::managingMarker with following code, or similar:

- (BOOL) managingMarker:(RMMarker*)marker
{
    NSArray* realMarkers = [self markers];
    //Danger! We can get index==0 if realMarkers is nil
    NSUInteger index = (realMarkers != nil) ? [realMarkers indexOfObject:marker] : NSNotFound;
    if (marker != nil && index != NSNotFound) {
        return YES;
    }
    return NO;
}

Because [self markers] can return nil if marker manager doesn't contain any 
markers, then we'll get indexOfObject == 0, not NSNotFound and method will 
return YES...

Original issue reported on code.google.com by mon.cas...@gmail.com on 18 Oct 2010 at 4:29