mirror of
https://github.com/ppy/osu.git
synced 2026-05-18 11:20:24 +08:00
Throw exceptions rather than silently failing if attempting to add a clock for a non-tracked user
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user