GetPlayerByID throws exception when playerID is not in players Dictionary
Guribo opened this issue · comments
Guribo commented
When trying to get a player by an invalid ID e.g. -1 it throws an exception instead of returning null.
Solution:
public static VRCPlayerApi GetPlayerByID(int playerID)
{
return players.TryGetValue(playerID, out var player) ? player : null;
}
Guribo commented
Thanks!