diff --git a/Assets/Mirror/Components/InterestManagement/Match/MatchInterestManagement.cs b/Assets/Mirror/Components/InterestManagement/Match/MatchInterestManagement.cs index 6f24e4b8c..15ff824a1 100644 --- a/Assets/Mirror/Components/InterestManagement/Match/MatchInterestManagement.cs +++ b/Assets/Mirror/Components/InterestManagement/Match/MatchInterestManagement.cs @@ -64,11 +64,10 @@ void UpdateMatchObjects(NetworkMatch match, Guid oldMatch) { HashSet matchSet = matchObjects[oldMatch]; matchSet.Remove(match); + // clean up empty entries in the dict if (matchSet.Count == 0) - { matchObjects.Remove(oldMatch); - } } // Make sure this new match is in the dictionary