diff --git a/Assets/BossRoom/Scripts/Server/Game/State/ServerBossRoomState.cs b/Assets/BossRoom/Scripts/Server/Game/State/ServerBossRoomState.cs index f32a5260f..2e37b0b15 100644 --- a/Assets/BossRoom/Scripts/Server/Game/State/ServerBossRoomState.cs +++ b/Assets/BossRoom/Scripts/Server/Game/State/ServerBossRoomState.cs @@ -164,7 +164,7 @@ protected override void OnDestroy() private MLAPI.NetworkVariable.NetworkVariable.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(); return netState != null ? netState.NetworkLifeState.OnValueChanged : null;