Skip to content

Commit

Permalink
fix: NetworkIdentity.RebuildObservers: added missing null check for o…
Browse files Browse the repository at this point in the history
…bservers coming from components that implement OnRebuildObservers. Previously this caused a NullReferenceException.
  • Loading branch information
miwarnec committed Mar 4, 2020
1 parent 26c0c03 commit a5f495a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Assets/Mirror/Runtime/NetworkIdentity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit a5f495a

Please sign in to comment.