diff --git a/ArchiSteamFarm.OfficialPlugins.ItemsMatcher/RemoteCommunication.cs b/ArchiSteamFarm.OfficialPlugins.ItemsMatcher/RemoteCommunication.cs index 91840048d..5351ba560 100644 --- a/ArchiSteamFarm.OfficialPlugins.ItemsMatcher/RemoteCommunication.cs +++ b/ArchiSteamFarm.OfficialPlugins.ItemsMatcher/RemoteCommunication.cs @@ -233,6 +233,7 @@ internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable { HashSet acceptedMatchableTypes = Bot.BotConfig.MatchableTypes.Where(AcceptedMatchableTypes.Contains).ToHashSet(); if (acceptedMatchableTypes.Count == 0) { + // Should never happen, since IsEligibleForListing() check above ensured we have at least one matchable type throw new InvalidOperationException(nameof(acceptedMatchableTypes)); } @@ -905,9 +906,8 @@ internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable { HashSet acceptedMatchableTypes = Bot.BotConfig.MatchableTypes.Where(AcceptedMatchableTypes.Contains).ToHashSet(); if (acceptedMatchableTypes.Count == 0) { - Bot.ArchiLogger.LogNullError(acceptedMatchableTypes); - - return; + // Should never happen, since IsEligibleForMatching() check above ensured we have at least one matchable type + throw new InvalidOperationException(nameof(acceptedMatchableTypes)); } if (!await MatchActivelySemaphore.WaitAsync(0).ConfigureAwait(false)) { diff --git a/ArchiSteamFarm/Steam/Exchange/Trading.cs b/ArchiSteamFarm/Steam/Exchange/Trading.cs index 5321a8111..d14cb68b8 100644 --- a/ArchiSteamFarm/Steam/Exchange/Trading.cs +++ b/ArchiSteamFarm/Steam/Exchange/Trading.cs @@ -503,7 +503,7 @@ public sealed class Trading : IDisposable { } // Decline trade if we're requested to handle any not-accepted item type or if it's not fair games/types exchange - if (!tradeOffer.IsValidSteamItemsRequest(Bot.BotConfig.MatchableTypes) || !IsFairExchange(tradeOffer.ItemsToGive, tradeOffer.ItemsToReceive)) { + if (Bot.BotConfig.MatchableTypes.IsEmpty || !tradeOffer.IsValidSteamItemsRequest(Bot.BotConfig.MatchableTypes) || !IsFairExchange(tradeOffer.ItemsToGive, tradeOffer.ItemsToReceive)) { Bot.ArchiLogger.LogGenericDebug(Strings.FormatBotTradeOfferResult(tradeOffer.TradeOfferID, ParseTradeResult.EResult.Rejected, $"{nameof(tradeOffer.IsValidSteamItemsRequest)} || {nameof(IsFairExchange)}")); return ParseTradeResult.EResult.Rejected;