Skip to content

Commit

Permalink
Avoid NRE from GetGlyphPath (#14530)
Browse files Browse the repository at this point in the history
Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com>
  • Loading branch information
maxkatz6 and jmacato committed Feb 9, 2024
1 parent 8a540e3 commit 1a7a99c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Skia/Avalonia.Skia/PlatformRenderInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public IGeometryImpl BuildGlyphRunGeometry(GlyphRun glyphRun)
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);
}
Expand Down

0 comments on commit 1a7a99c

Please sign in to comment.