Răsfoiți Sursa

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 an în urmă
părinte
comite
b865cc41c4
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  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.");
                 throw new ArgumentException("Font stretch must be > 1.");
             }
             }
 
 
-            FontFamily = fontFamily;
+            FontFamily = fontFamily ?? FontFamily.Default;
             Style = style;
             Style = style;
             Weight = weight;
             Weight = weight;
             Stretch = stretch;
             Stretch = stretch;