Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding null check for context before calling Utils.getAnimationScale #2546

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

pranayairan
Copy link
Contributor

When calling reduce motion check we need to pass context, we read context in LottieDrawable using getContext method. getContext method can return a nullable context, since the code is in java we don't get any compile time error when passing the null context around.

This resulted in issue where we end up calling getContentResolver on a null object in case where context is null. #2536

This PR fixes it by adding a null check before calling Utils.getAnimationScale(context)

adding null check for context
Copy link

github-actions bot commented Sep 3, 2024

Snapshot Tests
API 23: Report Diff
API 31: Report Diff

@gpeal gpeal merged commit 453b43c into airbnb:master Sep 4, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants