Browse Source

Avoid NRE from GetGlyphPath (#14530)

Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com>
pull/14542/head
Max Katz 3 years ago
committed by GitHub
parent
commit
2c1512d096
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      src/Skia/Avalonia.Skia/PlatformRenderInterface.cs

2
src/Skia/Avalonia.Skia/PlatformRenderInterface.cs

@ -94,7 +94,7 @@ namespace Avalonia.Skia
var glyph = glyphRun.GlyphInfos[i].GlyphIndex;
var glyphPath = skFont.GetGlyphPath(glyph);
if (!glyphPath.IsEmpty)
if (glyphPath is not null && !glyphPath.IsEmpty)
{
path.AddPath(glyphPath, (float)currentX, (float)currentY);
}

Loading…
Cancel
Save