From 59687675c978ca31131b8510db0b1eb8b58683d8 Mon Sep 17 00:00:00 2001 From: Paul Pacheco Date: Fri, 20 Mar 2020 07:58:46 -0500 Subject: [PATCH] Fix sonarqube null warning Once upon a time, connections could be null here. This is no longer the case, connections always have something, Even if they were null, this method would not work at all because the conn.Send call at the bottom would throw NRE. Therefore the null checks here are unnecesary --- Assets/Mirror/Runtime/NetworkServer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Mirror/Runtime/NetworkServer.cs b/Assets/Mirror/Runtime/NetworkServer.cs index b0f9b5945..99cd05a75 100644 --- a/Assets/Mirror/Runtime/NetworkServer.cs +++ b/Assets/Mirror/Runtime/NetworkServer.cs @@ -940,8 +940,8 @@ internal static void SendSpawnMessage(NetworkIdentity identity, NetworkConnectio SpawnMessage msg = new SpawnMessage { netId = identity.netId, - isLocalPlayer = conn?.identity == identity, - isOwner = identity.connectionToClient == conn && conn != null, + isLocalPlayer = conn.identity == identity, + isOwner = identity.connectionToClient == conn, sceneId = identity.sceneId, assetId = identity.assetId, // use local values for VR support