diff --git a/source/FFImageLoading.Svg.Shared/SkSvg.cs b/source/FFImageLoading.Svg.Shared/SkSvg.cs index 7af23e68f..efc6d143f 100644 --- a/source/FFImageLoading.Svg.Shared/SkSvg.cs +++ b/source/FFImageLoading.Svg.Shared/SkSvg.cs @@ -441,7 +441,7 @@ private void ReadElement(XElement e, SKCanvas canvas, SKPaint stroke, SKPaint fi foreach (var gElement in e.Elements()) { - using (var paint = fill.Clone()) + using (var paint = fill?.Clone() ?? CreatePaint()) { paint.BlendMode = SKBlendMode.SrcIn; ReadElement(gElement, canvas, paint, paint); @@ -521,7 +521,7 @@ private void ReadElement(XElement e, SKCanvas canvas, SKPaint stroke, SKPaint fi case "mask": if (e.HasElements) { - masks.Add(ReadId(e), new SKSvgMask(fill, e)); + masks.Add(ReadId(e), new SKSvgMask(fill ?? CreatePaint(), e)); } break; case "defs":