diff --git a/platform/ios/src/MLNMapView.mm b/platform/ios/src/MLNMapView.mm index 56f5a385c..7f6ef9266 100644 --- a/platform/ios/src/MLNMapView.mm +++ b/platform/ios/src/MLNMapView.mm @@ -3550,7 +3550,12 @@ static void *windowScreenContext = &windowScreenContext; - (id)accessibilityElementForAnnotationWithTag:(MLNAnnotationTag)annotationTag { MLNAssert(_annotationContextsByAnnotationTag.count(annotationTag), @"Missing annotation for tag %llu.", annotationTag); - MLNAnnotationContext &annotationContext = _annotationContextsByAnnotationTag.at(annotationTag); + auto annotationContextIt = _annotationContextsByAnnotationTag.find(annotationTag); + if (annotationContextIt == _annotationContextsByAnnotationTag.end()) { + return nil; + } + + MLNAnnotationContext &annotationContext = annotationContextIt->second; id annotation = annotationContext.annotation; // Let the annotation view serve as its own accessibility element.