mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-06 16:32:24 +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);
|
||||
}
|
||||
PropHelper.RNSVGBrush brush = getSvgShadowNode().getDefinedBrush(colors.getString(1));
|
||||
brush.setupPaint(paint, box, mScale, opacity);
|
||||
if (brush != null) {
|
||||
brush.setupPaint(paint, box, mScale, opacity);
|
||||
}
|
||||
} else {
|
||||
// TODO: Support pattern.
|
||||
FLog.w(ReactConstants.TAG, "RNSVG: Color type " + colorType + " not supported!");
|
||||
|
||||
Reference in New Issue
Block a user