Browse Source

fix #15873, prevent FontFamily Property was null and crash the whole application (#15896)

* fix #15873

* fix: FontFamily wrong assignment

* Revert extra whitespaces

---------

Co-authored-by: Benedikt Stebner <[email protected]>
Acoris 1 year ago
parent
commit
b865cc41c4
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Avalonia.Base/Media/Typeface.cs

+ 1 - 1
src/Avalonia.Base/Media/Typeface.cs

@@ -31,7 +31,7 @@ namespace Avalonia.Media
                 throw new ArgumentException("Font stretch must be > 1.");
             }
 
-            FontFamily = fontFamily;
+            FontFamily = fontFamily ?? FontFamily.Default;
             Style = style;
             Weight = weight;
             Stretch = stretch;