From f5810227c0d090c1e441befb67a77dd9d8c87ded Mon Sep 17 00:00:00 2001 From: Max Katz Date: Wed, 7 Feb 2024 20:05:29 -0800 Subject: [PATCH] Avoid NRE from GetGlyphPath --- src/Skia/Avalonia.Skia/PlatformRenderInterface.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Skia/Avalonia.Skia/PlatformRenderInterface.cs b/src/Skia/Avalonia.Skia/PlatformRenderInterface.cs index 9972bcf506b..19df1249101 100644 --- a/src/Skia/Avalonia.Skia/PlatformRenderInterface.cs +++ b/src/Skia/Avalonia.Skia/PlatformRenderInterface.cs @@ -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); }