diff --git a/Mirror/Runtime/NetworkServer.cs b/Mirror/Runtime/NetworkServer.cs index 7913bdd75..8bbbeb7f7 100644 --- a/Mirror/Runtime/NetworkServer.cs +++ b/Mirror/Runtime/NetworkServer.cs @@ -847,8 +847,7 @@ static void OnCommandMessage(NetworkMessage netMsg) CommandMessage message = netMsg.ReadMessage(); NetworkIdentity identity; - NetworkIdentity.spawned.TryGetValue(message.netId, out identity); - if (identity == null) + if (!NetworkIdentity.spawned.TryGetValue(message.netId, out identity)) { Debug.LogWarning("Spawned object not found when handling Command message [netId=" + message.netId + "]"); return;