Browse Source

Fix the name of font family is null cause crash. #12190 (#16677)

Co-authored-by: jianwenlong <jian-wenlong@rui-hai.com>
pull/17021/head
Jerry Jian 1 year ago
committed by GitHub
parent
commit
f47b733a71
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      src/Avalonia.Base/Media/Typeface.cs

2
src/Avalonia.Base/Media/Typeface.cs

@ -48,7 +48,7 @@ namespace Avalonia.Media
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)
{
}

Loading…
Cancel
Save