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

Fix Potential NPE In NetworkCache.clearCache #2364

Merged
merged 2 commits into from Aug 19, 2023

Conversation

undermark5
Copy link
Contributor

In an app that I maintain, a crash was reported in Crashlytics indicating that there was a NPE in the Lottie library code.
Screenshot 2023-08-18 at 12 45 55 PM

It took me a bit to realize why the NPE was being caused by trying to read the length of a null array, but then I realized, the for loop calls parentDir.listFiles() again to iterate over rather than using the files array that was just checked the line above.

The changes are quite minor and should fix the problem of the NPE, that being said there may be other concerns that I'm not aware of.

@github-actions
Copy link

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

@gpeal gpeal merged commit 423665d into airbnb:master Aug 19, 2023
6 checks passed
@undermark5 undermark5 deleted the network_cache_clear_npe_fix branch August 29, 2023 19:31
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.

None yet

3 participants