From 635a3f21a0373335d4a334f5bb487251f027f47c Mon Sep 17 00:00:00 2001 From: Pablo Guardiola Date: Tue, 25 Jul 2017 13:01:31 +0200 Subject: [PATCH] [android] fix added to map checks because LongSparseArray#indexOfKey could return a negative number when the specified key is not mapped (#9602) --- .../main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java index ef794c8482b..251e5afabe9 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/AnnotationManager.java @@ -301,7 +301,7 @@ void updateMarker(@NonNull Marker updatedMarker) { } private boolean isAddedToMap(Annotation annotation) { - return annotation != null && annotation.getId() != -1 && annotations.indexOfKey(annotation.getId()) != -1; + return annotation != null && annotation.getId() != -1 && annotations.indexOfKey(annotation.getId()) > -1; } private void ensureIconLoaded(Marker marker) {