Skip to content

Commit

Permalink
Check condition before dispose "ObjectStreamData" (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
haiduong87 authored Jul 24, 2022
1 parent 845b50e commit 70bc9bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Minio/DataModel/ObjectOperationsArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1891,6 +1891,7 @@ public PutObjectArgs WithStreamData(Stream data)

~PutObjectArgs()
{
if (ObjectStreamData != null) ObjectStreamData.Close();
if (!string.IsNullOrWhiteSpace(FileName) && ObjectStreamData != null)
ObjectStreamData.Close();
}
}

0 comments on commit 70bc9bb

Please sign in to comment.