mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-09 12:54:51 +00:00
null checks
This commit is contained in:
parent
b0d26b9b44
commit
d5d039e29c
@ -61,12 +61,12 @@ namespace QSB
|
||||
|
||||
public static IEnumerable<T> GetSyncObjects<T>() where T : PlayerSyncObject
|
||||
{
|
||||
return PlayerSyncObjects.OfType<T>();
|
||||
return PlayerSyncObjects.OfType<T>().Where(x => x != null);
|
||||
}
|
||||
|
||||
public static T GetSyncObject<T>(uint id) where T : PlayerSyncObject
|
||||
{
|
||||
return GetSyncObjects<T>().FirstOrDefault(x => x.NetId == id);
|
||||
return GetSyncObjects<T>().FirstOrDefault(x => x != null && x.NetId == id);
|
||||
}
|
||||
|
||||
public static bool IsBelongingToLocalPlayer(uint id)
|
||||
|
Loading…
Reference in New Issue
Block a user