androidsvg
androidsvg copied to clipboard
Corner case bug - gradient radius 0 on Android SDK 31+ leads to NullPointerException
Describe the bug
In this line in SVGAndroidRenderer, if SUPPORTS_RADIAL_GRADIENT_WITH_FOCUS is true (we're on Android SDK 31 or above), then the colours array will be null, which will throw a NullPointerException.
To Reproduce I've found this when checking the code, so haven't reproduced this in practice, but in theory it would be:
- Render an SVG that contains a radial gradient with radius 0, on Android 31 or above
Expected behavior 2. Rendering works
Stack traces
SVG file
Screenshots
Device
- Android SDK 31 or above
Additional context
Yes. You are right. Good spot. Thanks vm for the report.