Fix NPE in GradientDrawable#getCornerRadii.

Bug: 183603359
Test: atest GradientDrawableTest
Change-Id: Ia81adff60e3e9831f0119826636e75f57420932f
This commit is contained in:
Jordan Demeulenaere
2021-03-24 15:32:56 +01:00
parent 07f3583061
commit 165995bebe

View File

@@ -276,7 +276,11 @@ public class GradientDrawable extends Drawable {
*/
@Nullable
public float[] getCornerRadii() {
return mGradientState.mRadiusArray.clone();
float[] radii = mGradientState.mRadiusArray;
if (radii == null) {
return null;
}
return radii.clone();
}
/**