Skip to content

Commit

Permalink
fixed another invalid usage of GetValueOrDefault
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadauxCat committed Aug 28, 2023
1 parent 3c20512 commit 08c63e6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,12 @@ public void SetPeerMTU(ulong clientId, int size)
/// <returns></returns>
public int GetPeerMTU(ulong clientId)
{
return MessageManager.PeerMTUSizes.GetValueOrDefault(clientId, MessageManager.NonFragmentedMessageMaxSize);
if (MessageManager.PeerMTUSizes.TryGetValue(clientId, out var ret))
{
return ret;
}

return MessageManager.NonFragmentedMessageMaxSize;
}

/// <summary>
Expand Down

0 comments on commit 08c63e6

Please sign in to comment.