Skip to content

Commit

Permalink
improve: modifies LiteNetLib to returns empty string instead of nul…
Browse files Browse the repository at this point in the history
…l string when length is 0
  • Loading branch information
insthync committed Apr 5, 2023
1 parent 8dc5e43 commit 3523d26
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Plugins/LiteNetLib/Utils/NetDataReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public string GetString(int maxLength)
ushort size = GetUShort();
if (size == 0)
{
return null;
return string.Empty;
}

int actualSize = size - 1;
Expand All @@ -304,7 +304,7 @@ public string GetString()
ushort size = GetUShort();
if (size == 0)
{
return null;
return string.Empty;
}

int actualSize = size - 1;
Expand Down Expand Up @@ -447,7 +447,7 @@ public string PeekString(int maxLength)
ushort size = PeekUShort();
if (size == 0)
{
return null;
return string.Empty;
}

int actualSize = size - 1;
Expand All @@ -466,7 +466,7 @@ public string PeekString()
ushort size = PeekUShort();
if (size == 0)
{
return null;
return string.Empty;
}

int actualSize = size - 1;
Expand Down

0 comments on commit 3523d26

Please sign in to comment.