fix: NetworkIdentity.RebuildObservers: added missing null check for observers coming from components that implement OnRebuildObservers. Previously this caused a NullReferenceException.

This commit is contained in:
vis2k 2020-03-04 14:55:27 +01:00
parent 26c0c03fd8
commit a5f495a774

View File

@ -1110,7 +1110,7 @@ public void RebuildObservers(bool initialize)
observers.Clear();
foreach (NetworkConnection conn in newObservers)
{
if (conn.isReady)
if (conn != null && conn.isReady)
observers.Add(conn.connectionId, conn);
}
}