Skip to content

Commit

Permalink
fix null exception throw new UnexpectedShortReadException(
Browse files Browse the repository at this point in the history
                    $"Data read {bytes.Length} is shorter than the size {args.ObjectSize} of input buffer."); if bytes is null
  • Loading branch information
Lanz86 authored and ebozduman committed Oct 27, 2022
1 parent 34f15b4 commit b8cf810
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Minio/ApiEndpoints/ObjectOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ public async Task PutObjectAsync(PutObjectArgs args, CancellationToken cancellat
var bytesRead = bytes == null ? 0 : bytes.Length;
if (bytesRead != (int)args.ObjectSize)
throw new UnexpectedShortReadException(
$"Data read {bytes.Length} is shorter than the size {args.ObjectSize} of input buffer.");
$"Data read {bytesRead} is shorter than the size {args.ObjectSize} of input buffer.");
args = args.WithRequestBody(bytes)
.WithStreamData(null)
.WithObjectSize(bytesRead);
Expand Down

0 comments on commit b8cf810

Please sign in to comment.