Skip to content

Commit 3a5e35e

Browse files
authored
fix: null check in onAnimationUpdate (#1161)
1 parent 97073ac commit 3a5e35e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

library/src/main/java/com/google/maps/android/clustering/view/DefaultClusterRenderer.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public int getClusterTextAppearance(int clusterSize) {
232232
return R.style.amu_ClusterIcon_TextAppearance; // Default value
233233
}
234234

235-
@NonNull
235+
@NonNull
236236
protected String getClusterText(int bucket) {
237237
if (bucket < BUCKETS[0]) {
238238
return String.valueOf(bucket);
@@ -1169,6 +1169,10 @@ public void removeOnAnimationComplete(MarkerManager markerManager) {
11691169

11701170
@Override
11711171
public void onAnimationUpdate(ValueAnimator valueAnimator) {
1172+
if (to == null || from == null || marker == null) {
1173+
return;
1174+
}
1175+
11721176
float fraction = valueAnimator.getAnimatedFraction();
11731177
double lat = (to.latitude - from.latitude) * fraction + from.latitude;
11741178
double lngDelta = to.longitude - from.longitude;

0 commit comments

Comments
 (0)