Skip to content

Commit

Permalink
Fix zero length stream catch on Blazor InputLargeTextArea sample (#98)
Browse files Browse the repository at this point in the history
* Fix zero length stream catch

* Parse length as long
  • Loading branch information
Rene-Sackers committed May 23, 2022
1 parent 4f0bf55 commit 5f2077b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public virtual async ValueTask<StreamReader> GetTextAsync(int maxLength = 32_000
// 0 length streams/textareas aren't permitted from JS->.NET Streaming Interop.
if (jsException.InnerException is ArgumentOutOfRangeException outOfRangeException &&
outOfRangeException.ActualValue is not null &&
outOfRangeException.ActualValue is int actualLength &&
outOfRangeException.ActualValue is long actualLength &&
actualLength == 0)
{
return StreamReader.Null;
Expand Down

0 comments on commit 5f2077b

Please sign in to comment.