Skip to content

Commit

Permalink
fix: null check in onAnimationUpdate (#1161)
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ga committed Aug 23, 2023
1 parent 97073ac commit 3a5e35e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public int getClusterTextAppearance(int clusterSize) {
return R.style.amu_ClusterIcon_TextAppearance; // Default value
}

@NonNull
@NonNull
protected String getClusterText(int bucket) {
if (bucket < BUCKETS[0]) {
return String.valueOf(bucket);
Expand Down Expand Up @@ -1169,6 +1169,10 @@ public void removeOnAnimationComplete(MarkerManager markerManager) {

@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
if (to == null || from == null || marker == null) {
return;
}

float fraction = valueAnimator.getAnimatedFraction();
double lat = (to.latitude - from.latitude) * fraction + from.latitude;
double lngDelta = to.longitude - from.longitude;
Expand Down

0 comments on commit 3a5e35e

Please sign in to comment.