-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Crash at ImageLayer.getBounds when ImageLayer.getBitmap() is null in version 6.6.1 #2601
Copy link
Copy link
Closed
Labels
Description
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:
- Do not place the default image file referenced by the image layer in the assets folder.
- Play the animation without updating the bitmap in the image layer.
- The application will crash.
Reactions are currently unavailable
