Actually throw on invalid input

Handling duplicates is fine, but this is userspace error
This commit is contained in:
Archi
2021-06-21 23:56:49 +02:00
parent 2cee5e442f
commit 2c9d131ceb

View File

@@ -518,11 +518,11 @@ namespace ArchiSteamFarm.Steam.Integration {
#pragma warning restore CA1508 // False positive, not every IReadOnlyCollection is ISet
foreach (uint gameID in uniqueValidGameIDs) {
request.Body.games_played.Add(new CMsgClientGamesPlayed.GamePlayed { game_id = new GameID(gameID) });
if (request.Body.games_played.Count >= maxGamesCount) {
break;
throw new InvalidOperationException(nameof(maxGamesCount));
}
request.Body.games_played.Add(new CMsgClientGamesPlayed.GamePlayed { game_id = new GameID(gameID) });
}
}