You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
[ios] Crash fix on render with view-backed annotations - #8513
Fixes#8163 while this is only a nil check, we need to continue investigating why annotationContext.annotation is nil when calling visibleAnnotationsInRect
We should audit the MGLMapView implementation for places where we use subscript notation ([]) on _annotationContextsByAnnotationTag. The tricky thing about std::map is that subscripting with a nonexistent key will create a bogus value to go with the key. That could be how the context ends up with a nil annotation. In most places, we’re using std::map::at(), which throws an exception, and checking for existence (with count()) before calling at().
even before I added a nil check we did checked with count()
Yes, but there are several other places in the code that use subscripting notation on _annotationContextsByAnnotationTag – could one of these places be responsible for the nil annotation? This PR is fine as a stopgap fix, but unless we also hunt down the root cause, we may well end up with bizarre behavior elsewhere in the annotation code and have even less of an idea what’s causing it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8163 while this is only a nil check, we need to continue investigating why
annotationContext.annotationis nil when callingvisibleAnnotationsInRect