Round 2 of nullable checks

This commit is contained in:
JustArchi
2020-08-23 20:45:24 +02:00
parent f99043db30
commit b3d476dea4
34 changed files with 187 additions and 338 deletions

View File

@@ -182,6 +182,7 @@ namespace ArchiSteamFarm {
return null;
}
// ReSharper disable once ConditionIsAlwaysTrueOrFalse - wrong, "null" json serializes into null object
if (botDatabase == null) {
ASF.ArchiLogger.LogNullError(nameof(botDatabase));
@@ -195,15 +196,17 @@ namespace ArchiSteamFarm {
internal IReadOnlyCollection<ulong> GetBlacklistedFromTradesSteamIDs() => BlacklistedFromTradesSteamIDs;
#pragma warning disable CS8605
internal (string? Key, string? Name) GetGameToRedeemInBackground() {
lock (GamesToRedeemInBackground) {
foreach (DictionaryEntry? game in GamesToRedeemInBackground) {
return (game?.Key as string, game?.Value as string);
foreach (DictionaryEntry game in GamesToRedeemInBackground) {
return (game.Key as string, game.Value as string);
}
}
return (null, null);
}
#pragma warning restore CS8605
internal IReadOnlyCollection<uint> GetIdlingBlacklistedAppIDs() => IdlingBlacklistedAppIDs;
internal IReadOnlyCollection<uint> GetIdlingPriorityAppIDs() => IdlingPriorityAppIDs;