Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ protected override void OnDestroy()
private MLAPI.NetworkVariable.NetworkVariable<LifeState>.OnValueChangedDelegate GetLifeStateEvent(ulong id)
{
//this is all a little paranoid, because during shutdown it's not always obvious what state is still valid.
if (NetworkSpawnManager.SpawnedObjects.TryGetValue(id, out NetworkObject netObj))
if (NetworkSpawnManager.SpawnedObjects.TryGetValue(id, out NetworkObject netObj) && netObj != null)
{
var netState = netObj.GetComponent<NetworkCharacterState>();
return netState != null ? netState.NetworkLifeState.OnValueChanged : null;
Expand Down