From d48c219178d5d03e38e1656be9f8bb91b362425a Mon Sep 17 00:00:00 2001 From: jianwenlong Date: Tue, 13 Aug 2024 16:16:41 +0800 Subject: [PATCH] Fix the name of font family is null cause crash. #12190 --- src/Avalonia.Base/Media/Typeface.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Base/Media/Typeface.cs b/src/Avalonia.Base/Media/Typeface.cs index d9bd1588867..3a221c3d2df 100644 --- a/src/Avalonia.Base/Media/Typeface.cs +++ b/src/Avalonia.Base/Media/Typeface.cs @@ -48,7 +48,7 @@ public Typeface(string fontFamilyName, FontStyle style = FontStyle.Normal, FontWeight weight = FontWeight.Normal, FontStretch stretch = FontStretch.Normal) - : this(new FontFamily(fontFamilyName), style, weight, stretch) + : this(fontFamilyName == null ? FontFamily.Default : new FontFamily(fontFamilyName), style, weight, stretch) { }