Skip to content

Commit

Permalink
fix(msgpack): fix MessagePackWriter.Bytes issue when writing empty by…
Browse files Browse the repository at this point in the history
…te array
  • Loading branch information
jasonboukheir committed Jul 11, 2022
1 parent a908586 commit eef81de
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ public unsafe void WriteBytes(void* buffer, int length)

public unsafe void WriteBytes(byte[] arr)
{
if (arr.Length == 0)
{
WriteBytesHeader(0);
return;
}
fixed (byte* buffer = &arr[0])
{
WriteBytes(buffer, arr.Length);
Expand Down

0 comments on commit eef81de

Please sign in to comment.