CyanLaser / CyanEmu

CyanEmu is a VRChat client emulator in Unity. Includes a player controller with interact system. Works with SDK2 and SDK3.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GetPlayerByID throws exception when playerID is not in players Dictionary

Guribo opened this issue · comments

When trying to get a player by an invalid ID e.g. -1 it throws an exception instead of returning null.

Issue:
image

return players[playerID];

Solution:

        public static VRCPlayerApi GetPlayerByID(int playerID)
        {
            return players.TryGetValue(playerID, out var player) ? player : null;
        }

Thank you for reporting this. I have implemented a fix in da7b431.

Thanks!