Skip to content

Commit

Permalink
fix #15873, prevent FontFamily Property was null and crash the whole …
Browse files Browse the repository at this point in the history
…application (#15896)

* fix #15873

* fix: FontFamily wrong assignment

* Revert extra whitespaces

---------

Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
  • Loading branch information
Luoyingliang and Gillibald authored Jul 16, 2024
1 parent 376a841 commit b865cc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Avalonia.Base/Media/Typeface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public Typeface(FontFamily fontFamily,
throw new ArgumentException("Font stretch must be > 1.");
}

FontFamily = fontFamily;
FontFamily = fontFamily ?? FontFamily.Default;
Style = style;
Weight = weight;
Stretch = stretch;
Expand Down

0 comments on commit b865cc4

Please sign in to comment.