Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencohn committed Jun 3, 2024
1 parent 2969e0b commit 25e7afc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions OneMore/Styles/StyleBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,18 @@ static StyleBase()
var key = Registry.CurrentUser.OpenSubKey(EditingKey, false);
if (key is not null)
{
if (key.GetValue("DefaultFontFace") is string family)
if (key.GetValue("DefaultFontFace") is string family &&
!string.IsNullOrWhiteSpace(family))
{
DefaultFontFamily = family;
}

if (key.GetValue("DefaultFontSize") is string size)
if (key.GetValue("DefaultFontSize") is string size &&
double.TryParse(size,
NumberStyles.AllowDecimalPoint,
CultureInfo.InvariantCulture, out var result))
{
DefaultFontSize = double.Parse(size, CultureInfo.InvariantCulture);
DefaultFontSize = result;
}
}
}
Expand Down

0 comments on commit 25e7afc

Please sign in to comment.