Skip to content

Commit 5a413bd

Browse files
DennisWelumattqs
authored andcommitted
Fix loss of sibling properties in JSON with binary data (#105)
1 parent b8f11c7 commit 5a413bd

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

  • Src/SocketIoClientDotNet.net45/Parser

Src/SocketIoClientDotNet.net45/Parser/Binary.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ private static object _reconstructPacket(object data, byte[][] buffers)
161161
//newData[i] = (string) recValue;
162162
newData.Add((string)recValue);
163163
}
164-
165-
if (recValue is byte[])
164+
else if (recValue is byte[])
166165
{
167166
newData.Add((byte[])recValue);
168167
}
@@ -204,7 +203,11 @@ private static object _reconstructPacket(object data, byte[][] buffers)
204203
try
205204
{
206205
var recValue = _reconstructPacket(property.Value, buffers);
207-
if (recValue is byte[])
206+
if (recValue is string)
207+
{
208+
newData1[property.Name] = (string)recValue;
209+
}
210+
else if (recValue is byte[])
208211
{
209212
newData1[property.Name] = (byte[])recValue;
210213
}

0 commit comments

Comments
 (0)