Skip to content

Commit

Permalink
fix invalid cast exception
Browse files Browse the repository at this point in the history
  • Loading branch information
drowhunter committed Aug 14, 2024
1 parent 833d89e commit 78666c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion FormHelper/Settings/UserSettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,8 @@ public object this[string name]
public T Get<T>(string name)
{
var setting = _settings.FirstOrDefault(s => s.Name == name)?.Value;
return (T) setting;
var retval = Convert.ChangeType(setting, typeof(T));
return (T) retval;
}

override public string ToString()
Expand Down

0 comments on commit 78666c2

Please sign in to comment.