Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a null exception throw if bytes variable is empty #689

Merged
merged 1 commit into from
Nov 1, 2022

Conversation

Lanz86
Copy link
Contributor

@Lanz86 Lanz86 commented Sep 13, 2022

When passing a void stream the bytes variable assumes a null value.
After this check
if (bytesRead != (int)args.ObjectSize)
the relative exception

throw new UnexpectedShortReadException(
                    $"Data read {bytes.Length} is shorter than the size {args.ObjectSize} of input buffer.");

throw another exception (NullReference) because bytes variable is null.

                    $"Data read {bytes.Length} is shorter than the size {args.ObjectSize} of input buffer."); if bytes is null
@ebozduman ebozduman merged commit 562eec1 into minio:master Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants