Skip to content

Commit

Permalink
🐛 fix: nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
capdiem committed Jul 21, 2023
1 parent 125f297 commit c80d436
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Masa.Blazor/Components/TextField/MTextField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ private async Task OnValueChangedAsync(ChangeEventArgs args, EventCallback<TValu
}
}

private static bool TryConvertTo<T>(string? value, out T result)
private static bool TryConvertTo<T>(string? value, out T? result)
{
var succeeded = BindConverter.TryConvertTo<T>(value, CultureInfo.InvariantCulture, out var val);

Expand All @@ -718,11 +718,11 @@ private static bool TryConvertTo<T>(string? value, out T result)
return true;
}

result = default!;
result = default;
return false;
}

private void UpdateValue(string? originValue, bool succeeded, TValue convertedValue)
private void UpdateValue(string? originValue, bool succeeded, TValue? convertedValue)
{
if (succeeded)
{
Expand Down

0 comments on commit c80d436

Please sign in to comment.