androidsvg icon indicating copy to clipboard operation
androidsvg copied to clipboard

Corner case bug - gradient radius 0 on Android SDK 31+ leads to NullPointerException

Open attilatanyi opened this issue 3 years ago • 1 comments

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:

  1. 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

attilatanyi avatar Aug 21 '22 19:08 attilatanyi

Yes. You are right. Good spot. Thanks vm for the report.

BigBadaboom avatar Aug 22 '22 02:08 BigBadaboom