diff --git a/ArchiSteamFarm/Steam/Data/InventoryDescription.cs b/ArchiSteamFarm/Steam/Data/InventoryDescription.cs index 3fc6fc41f0c1f..e896db1f78b9f 100644 --- a/ArchiSteamFarm/Steam/Data/InventoryDescription.cs +++ b/ArchiSteamFarm/Steam/Data/InventoryDescription.cs @@ -215,9 +215,10 @@ public EAssetRarity Rarity { } case "RARITY": string[] internalNameArgs = tag.internal_name.Split('_', 2, StringSplitOptions.RemoveEmptyEntries); + string rarityText = internalNameArgs.Length > 1 ? internalNameArgs[1] : internalNameArgs[0]; - if ((internalNameArgs.Length >= 2) && Enum.TryParse(internalNameArgs[1], true, out EAssetRarity assetRarity) && Enum.IsDefined(assetRarity)) { - CachedRarity = assetRarity; + if (Enum.TryParse(rarityText, true, out EAssetRarity rarity) && Enum.IsDefined(rarity)) { + CachedRarity = rarity; } else { ASF.ArchiLogger.LogGenericError(Strings.FormatWarningUnknownValuePleaseReport(nameof(tag.internal_name), tag.internal_name));