Skip to content

Commit 6a98083

Browse files
Fix uploading 0 byte files (microsoft#3717) (microsoft#3719)
1 parent b8afdf0 commit 6a98083

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Core/Components/InputFile/FluentInputFile.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ private async Task ReadFileToBufferAndRaiseProgressEventAsync(IBrowserFile file,
403403

404404
private Task UpdateProgressAsync(long current, long size, string title)
405405
{
406-
return UpdateProgressAsync(Convert.ToInt32(decimal.Divide(current, size) * 100), title);
406+
return UpdateProgressAsync(Convert.ToInt32(decimal.Divide(current, size <= 0 ? 1 : size) * 100), title);
407407
}
408408

409409
private async Task UpdateProgressAsync(int percent, string title)

0 commit comments

Comments
 (0)