mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-16 18:50:07 +08:00
Fixed array bounds error in MapView
Summary: fixed a case where MapView could crash due to a race condition Differential Revision: D3207304 fb-gh-sync-id: a63918d160258d76fce5d56994100a63f4c5fb68 fbshipit-source-id: a63918d160258d76fce5d56994100a63f4c5fb68
This commit is contained in:
committed by
Facebook Github Bot 0
parent
7192984c13
commit
446d7b7c17
@@ -179,7 +179,8 @@ RCT_CUSTOM_VIEW_PROPERTY(region, MKCoordinateRegion, RCTMap)
|
||||
}
|
||||
|
||||
MKAnnotationView *annotationView;
|
||||
if (annotation.viewIndex != NSNotFound) {
|
||||
if (annotation.viewIndex != NSNotFound &&
|
||||
annotation.viewIndex < mapView.reactSubviews.count) {
|
||||
|
||||
NSString *reuseIdentifier = NSStringFromClass([RCTMapAnnotationView class]);
|
||||
annotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:reuseIdentifier];
|
||||
|
||||
Reference in New Issue
Block a user