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

Crash at ImageLayer.getBounds when ImageLayer.getBitmap() is null in version 6.6.1 #2601

Open
bubble2025 opened this issue Dec 16, 2024 · 0 comments · May be fixed by #2578
Open

Crash at ImageLayer.getBounds when ImageLayer.getBitmap() is null in version 6.6.1 #2601

bubble2025 opened this issue Dec 16, 2024 · 0 comments · May be fixed by #2578

Comments

@bubble2025
Copy link

bubble2025 commented Dec 16, 2024

Describe the bug
When attempting to dynamically change the bitmap in an image layer without putting the original reference image in the assets folder, the getBitmap() method in the ImageLayer returns null. However, a crash occurs at getBounds() (line 110) because the code does not check if the bitmap is null before attempting to access its width and height.

Sometimes, we want to dynamically change the image, and if no image is provided, we prefer to display an empty area at the image layer's position.

What version of Lottie did you test this on?
6.6.1
What version of Android did you test this on?
Android 14
Steps To Reproduce
Steps to reproduce the behavior:

  1. Do not place the default image file referenced by the image layer in the assets folder.
  2. Play the animation without updating the bitmap in the image layer.
  3. The application will crash.

Screenshots
截圖 2024-12-16 下午4 39 51

@gpeal gpeal linked a pull request Dec 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant