From 2c1512d096badfe336b06658a3be2410cc8892c9 Mon Sep 17 00:00:00 2001 From: Max Katz Date: Wed, 7 Feb 2024 23:31:30 -0800 Subject: [PATCH] Avoid NRE from GetGlyphPath (#14530) Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com> --- 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 9972bcf506..19df124910 100644 --- a/src/Skia/Avalonia.Skia/PlatformRenderInterface.cs +++ b/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); }