Skip to content

Commit 6dada66

Browse files
shtrophicChristoph Liebender
andauthored
Set Stream.Position in FileAttachment-ctor to 0 (#2063)
Co-authored-by: Christoph Liebender <[email protected]>
1 parent 5773b8e commit 6dada66

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Discord.Net.Core/Entities/Messages/FileAttachment.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ public FileAttachment(Stream stream, string fileName, string description = null,
3232
FileName = fileName;
3333
Description = description;
3434
Stream = stream;
35+
try
36+
{
37+
Stream.Position = 0;
38+
}
39+
catch { }
3540
IsSpoiler = isSpoiler;
3641
}
3742

0 commit comments

Comments
 (0)