Skip to content

Commit

Permalink
fix: NRE when disconnecting with no owned objects
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpach committed Oct 15, 2020
1 parent 6590a1b commit 4e7983e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Assets/Mirror/Runtime/NetworkConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,9 @@ public void DestroyOwnedObjects()
}
}

// Destroy the connections own identity.
Identity.Server.Destroy(Identity.gameObject);
if (Identity != null && Identity.Server != null)
// Destroy the connections own identity.
Identity.Server.Destroy(Identity.gameObject);

// clear the hashset because we destroyed them all
clientOwnedObjects.Clear();
Expand Down

0 comments on commit 4e7983e

Please sign in to comment.