[ios] assertion to check if an annotationTag > 0 (#8588)

* [ios] assertion to check if an annotationTag > 0

* [ios,macos] assertion and guard added to check annotations in  visibleAnnotationsInRect
This commit is contained in:
Fabian Guerra Soto
2017-04-05 14:16:58 -04:00
committed by GitHub
parent 8539d7092e
commit ec34813c90
2 changed files with 7 additions and 1 deletions

View File

@@ -3060,10 +3060,12 @@ public:
continue;
}
MGLAnnotationContext annotationContext = _annotationContextsByAnnotationTag.at(annotationTag);
NSAssert(annotationContext.annotation, @"Missing annotation for tag %u.", annotationTag);
if (annotationContext.annotation)
{
[annotations addObject:annotationContext.annotation];
}
}
return [annotations copy];

View File

@@ -1801,7 +1801,11 @@ public:
continue;
}
MGLAnnotationContext annotationContext = _annotationContextsByAnnotationTag.at(annotationTag);
[annotations addObject:annotationContext.annotation];
NSAssert(annotationContext.annotation, @"Missing annotation for tag %u.", annotationTag);
if (annotationContext.annotation)
{
[annotations addObject:annotationContext.annotation];
}
}
return [annotations copy];