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

Throw exceptions rather than silently failing if attempting to add a clock for a non-tracked user

This commit is contained in:
Dean Herbert 2021-07-06 14:56:00 +09:00
parent 1a6b8b2c73
commit 0658cfb986

View File

@ -19,7 +19,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
public void AddClock(int userId, IClock clock)
{
if (!UserScores.TryGetValue(userId, out var data))
return;
throw new ArgumentException(@"Provided user is not tracked by this leaderboard", nameof(userId));
((SpectatingTrackedUserData)data).Clock = clock;
}
@ -27,7 +27,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
public void RemoveClock(int userId)
{
if (!UserScores.TryGetValue(userId, out var data))
return;
throw new ArgumentException(@"Provided user is not tracked by this leaderboard", nameof(userId));
((SpectatingTrackedUserData)data).Clock = null;
}