From fdff38c6194734a8f45849a82a0e844e2e860264 Mon Sep 17 00:00:00 2001 From: Fabian Guerra Date: Thu, 23 Mar 2017 15:13:06 -0400 Subject: [PATCH] [ios] nil check in visibleAnnotationsInRect to avoid crash --- platform/ios/src/MGLMapView.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 1baebf60bce..6ce41d6fb4d 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -3044,7 +3044,10 @@ - (void)removeStyleClass:(NSString *)styleClass continue; } MGLAnnotationContext annotationContext = _annotationContextsByAnnotationTag.at(annotationTag); - [annotations addObject:annotationContext.annotation]; + if (annotationContext.annotation) + { + [annotations addObject:annotationContext.annotation]; + } } return [annotations copy];