diff --git a/QSB/PlayerRegistry.cs b/QSB/PlayerRegistry.cs index f3691b13..402ebd3f 100644 --- a/QSB/PlayerRegistry.cs +++ b/QSB/PlayerRegistry.cs @@ -61,12 +61,12 @@ namespace QSB public static IEnumerable GetSyncObjects() where T : PlayerSyncObject { - return PlayerSyncObjects.OfType(); + return PlayerSyncObjects.OfType().Where(x => x != null); } public static T GetSyncObject(uint id) where T : PlayerSyncObject { - return GetSyncObjects().FirstOrDefault(x => x.NetId == id); + return GetSyncObjects().FirstOrDefault(x => x != null && x.NetId == id); } public static bool IsBelongingToLocalPlayer(uint id)