Skip to content

Loading…

Fixed false positive issue in RMMarkerManager managingMarker. #175

Merged
merged 1 commit into from

2 participants

@mdales

If called early it returns a false positive, as markers is nil.

Although this method is deprecated, it's better to fix it if we still have the code. I have some old code which used this method and it cost me an hour trying to track it down :)

@mdales mdales Fixed bug in RMMarkerManager managingMarker.
If called early it returns a false positive, as markers is nil.
Although this is deprecated, it's better to fix it if we still have the code.
087803d
@vyskocil vyskocil merged commit 7df74dc into route-me:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 12, 2012
  1. @mdales

    Fixed bug in RMMarkerManager managingMarker.

    mdales committed
    If called early it returns a false positive, as markers is nil.
    Although this is deprecated, it's better to fix it if we still have the code.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1 MapView/Map/RMMarkerManager.m
View
3 MapView/Map/RMMarkerManager.m
@@ -162,7 +162,8 @@ - (BOOL) isMarker:(RMMarker*)marker withinBounds:(CGRect)rect
/// \deprecated violates Objective-C naming rules
- (BOOL) managingMarker:(RMMarker*)marker
{
- if (marker != nil && [[self markers] indexOfObject:marker] != NSNotFound) {
+ NSArray *markers = [self markers];
+ if (marker != nil && markers != nil && [markers indexOfObject:marker] != NSNotFound) {
return YES;
}
return NO;
Something went wrong with that request. Please try again.