From fcd2be72386b7d44f868c479999d608ed0b9b166 Mon Sep 17 00:00:00 2001 From: eheimburg <74330250+eheimburg@users.noreply.github.com> Date: Tue, 27 Apr 2021 14:06:02 -0400 Subject: [PATCH] another null-check --- .../BossRoom/Scripts/Server/Game/State/ServerBossRoomState.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;