Summary:
NullPointerException on removing item from ClusterManager with NonHierarchicalDistanceBasedAlgorithm when there are more than 1000 items.
Steps to reproduce:
Add 1000 items.
Remove 1 item.
Expected behavior:
Remove the item.
Observed behavior:
Crash. NPE.
Device and Android version:
Android L,M.
Screenshots:
E/UncaughtException: java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.remove(java.lang.Object)' on a null object reference
at com.google.maps.android.quadtree.PointQuadTree.remove(PointQuadTree.java:176)
at com.google.maps.android.quadtree.PointQuadTree.remove(PointQuadTree.java:171)
at com.google.maps.android.quadtree.PointQuadTree.remove(PointQuadTree.java:153)
at com.google.maps.android.clustering.algo.NonHierarchicalDistanceBasedAlgorithm.removeItem(NonHierarchicalDistanceBasedAlgorithm.java:95)
at com.google.maps.android.clustering.algo.PreCachingAlgorithmDecorator.removeItem(PreCachingAlgorithmDecorator.java:61)
at com.google.maps.android.clustering.ClusterManager.removeItem(ClusterManager.java:161)
at com.giacomodeglinnocenti.myApp.controllers.MapClusterManager.removeItem(MapClusterManager.java:72)
**It is possible this is a duplicate of #308 ? In case I see that the guy there fixed the issue via PR.. But maybe the code has not been added to maven? **
I'm using the following dependency:
compile 'com.google.maps.android:android-maps-utils:0.4.+'