mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-08 01:00:43 +00:00
Android: Fix NPE in configuring brush
Fixing a NPE found when running the Example test, since the brush returned from getDefinedBrush() may be null.
This commit is contained in:
@@ -310,7 +310,9 @@ public class RNSVGPathShadowNode extends RNSVGVirtualNode {
|
|||||||
mPath.computeBounds(box, true);
|
mPath.computeBounds(box, true);
|
||||||
}
|
}
|
||||||
PropHelper.RNSVGBrush brush = getSvgShadowNode().getDefinedBrush(colors.getString(1));
|
PropHelper.RNSVGBrush brush = getSvgShadowNode().getDefinedBrush(colors.getString(1));
|
||||||
brush.setupPaint(paint, box, mScale, opacity);
|
if (brush != null) {
|
||||||
|
brush.setupPaint(paint, box, mScale, opacity);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO: Support pattern.
|
// TODO: Support pattern.
|
||||||
FLog.w(ReactConstants.TAG, "RNSVG: Color type " + colorType + " not supported!");
|
FLog.w(ReactConstants.TAG, "RNSVG: Color type " + colorType + " not supported!");
|
||||||
|
|||||||
Reference in New Issue
Block a user