Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

-[MGLMapView viewForAnnotation:] crashes when given annotation not on the map — map::at: key not found #6953

Closed
1ec5 opened this issue Nov 8, 2016 · 2 comments
Assignees
Labels
annotations Annotations on iOS and macOS or markers on Android crash iOS Mapbox Maps SDK for iOS
Milestone

Comments

@1ec5
Copy link
Contributor

1ec5 commented Nov 8, 2016

As reported in #6952 (comment), -[MGLMapView viewForAnnotation:] segfaults if you give it an MGLAnnotation that hasn’t been added to the MGLMapView or if you give it the user location annotation.

#1	0x000000010723788b in std::__1::map<id<MGLAnnotation> __strong, unsigned int, std::__1::less<id<MGLAnnotation> >, std::__1::allocator<std::__1::pair<objc_object<MGLAnnotation> const __strong, unsigned int> > >::at(std::__1::pair&) at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map:1578
#2	0x0000000107237755 in ::-[MGLMapView viewForAnnotation:](id) at /path/to/mapbox-gl-native-2/platform/ios/src/MGLMapView.mm:3104

/cc @boundsj

@1ec5 1ec5 added iOS Mapbox Maps SDK for iOS crash annotations Annotations on iOS and macOS or markers on Android labels Nov 8, 2016
@1ec5 1ec5 added this to the ios-v3.4.0 milestone Nov 8, 2016
@1ec5 1ec5 self-assigned this Nov 8, 2016
@1ec5
Copy link
Contributor Author

1ec5 commented Nov 8, 2016

This regression was introduced in #5987.

@boundsj
Copy link
Contributor

boundsj commented Nov 14, 2016

This was fixed in #6957

@boundsj boundsj closed this as completed Nov 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
annotations Annotations on iOS and macOS or markers on Android crash iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

2 participants