Skip to content

Commit

Permalink
Avoid always caught exception for unset settings (#11159)
Browse files Browse the repository at this point in the history
  • Loading branch information
mstv committed Aug 20, 2023
1 parent 5fc8e6d commit 027e83a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions GitCommands/Settings/Setting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ public bool IsUnset
private object? GetValue(string name)
{
string? stringValue = SettingsSource.GetValue(name);
if (stringValue is null)
{
return null;
}

Type type = typeof(T);
Type underlyingType = Nullable.GetUnderlyingType(type) ?? type;
Expand Down

0 comments on commit 027e83a

Please sign in to comment.