1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 15:23:14 +08:00

Add asserts of playlist being non-empty after client operations

This commit is contained in:
Dean Herbert 2022-03-24 17:47:58 +09:00
parent d7faff15c0
commit e889d93441

View File

@ -171,6 +171,8 @@ namespace osu.Game.Online.Multiplayer
Room = joinedRoom;
APIRoom = room;
Debug.Assert(joinedRoom.Playlist.Count > 0);
APIRoom.Playlist.Clear();
APIRoom.Playlist.AddRange(joinedRoom.Playlist.Select(createPlaylistItem));
@ -683,6 +685,8 @@ namespace osu.Game.Online.Multiplayer
Room.Playlist.Remove(Room.Playlist.Single(existing => existing.ID == playlistItemId));
APIRoom.Playlist.RemoveAll(existing => existing.ID == playlistItemId);
Debug.Assert(Room.Playlist.Count > 0);
ItemRemoved?.Invoke(playlistItemId);
RoomUpdated?.Invoke();
});