mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 23:42:55 +08:00
Don't fail if the local user is not present in room users when updating ready button state
This commit is contained in:
parent
f9900720d5
commit
fe1bbb1cac
@ -60,7 +60,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
||||
{
|
||||
base.OnRoomUpdated();
|
||||
|
||||
localUser = Room?.Users.Single(u => u.User?.Id == api.LocalUser.Value.Id);
|
||||
// this method is called on leaving the room, so the local user may not exist in the room any more.
|
||||
localUser = Room?.Users.SingleOrDefault(u => u.User?.Id == api.LocalUser.Value.Id);
|
||||
|
||||
button.Enabled.Value = Client.Room?.State == MultiplayerRoomState.Open;
|
||||
updateState();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user