From 6ff1d0a2d9fdcac4a4ba1f8a34716aa90e04333d Mon Sep 17 00:00:00 2001 From: Archi Date: Sat, 17 Dec 2022 13:09:01 +0100 Subject: [PATCH] Fix possible crash during matching --- .../RemoteCommunication.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ArchiSteamFarm.OfficialPlugins.ItemsMatcher/RemoteCommunication.cs b/ArchiSteamFarm.OfficialPlugins.ItemsMatcher/RemoteCommunication.cs index f9f3af16d..5232d1768 100644 --- a/ArchiSteamFarm.OfficialPlugins.ItemsMatcher/RemoteCommunication.cs +++ b/ArchiSteamFarm.OfficialPlugins.ItemsMatcher/RemoteCommunication.cs @@ -493,6 +493,10 @@ internal sealed class RemoteCommunication : IAsyncDisposable, IDisposable { HashSet theirInventory = listedUser.Assets.Where(item => (!listedUser.MatchEverything || item.Tradable) && wantedSets.Contains((item.RealAppID, item.Type, item.Rarity)) && ((tradeHoldDuration.Value == 0) || !(item.Type is Asset.EType.FoilTradingCard or Asset.EType.TradingCard && CardsFarmer.SalesBlacklist.Contains(item.RealAppID)))).Select(static asset => asset.ToAsset()).ToHashSet(); + if (theirInventory.Count == 0) { + continue; + } + HashSet<(uint RealAppID, Asset.EType Type, Asset.ERarity Rarity)> skippedSetsThisUser = new(); Dictionary<(uint RealAppID, Asset.EType Type, Asset.ERarity Rarity), Dictionary> theirTradableState = Trading.GetTradableInventoryState(theirInventory);