{"record":{"id":"bf092a5c2136cfd0","repo":"JustArchiNET/ArchiSteamFarm","slug":"steamid-is-null","errorCode":null,"errorMessage":"steamID is null!","messagePattern":"steamID is null!","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"ArchiSteamFarm/Steam/Integration/ArchiWebHandler.cs","lineNumber":306,"sourceCode":"\t\tArgumentOutOfRangeException.ThrowIfZero(contextID);\n\t\tArgumentOutOfRangeException.ThrowIfZero(itemsCountPerRequest);\n\n\t\tif (steamID == 0) {\n\t\t\tif (!Initialized) {\n\t\t\t\tbyte connectionTimeout = ASF.GlobalConfig?.ConnectionTimeout ?? GlobalConfig.DefaultConnectionTimeout;\n\n\t\t\t\tfor (byte i = 0; (i < connectionTimeout) && !Initialized && Bot.IsConnectedAndLoggedOn; i++) {\n\t\t\t\t\tawait Task.Delay(1000).ConfigureAwait(false);\n\t\t\t\t}\n\n\t\t\t\tif (!Initialized) {\n\t\t\t\t\tthrow new HttpRequestException(Strings.WarningFailed);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsteamID = Bot.SteamID;\n\t\t} else if (!new SteamID(steamID).IsIndividualAccount) {\n\t\t\tthrow new NotSupportedException(Strings.FormatErrorObjectIsNull(nameof(steamID)));\n\t\t}\n\n\t\tif (ASF.InventorySemaphore == null) {\n\t\t\tthrow new InvalidOperationException(nameof(ASF.InventorySemaphore));\n\t\t}\n\n\t\tif (string.IsNullOrEmpty(language)) {\n\t\t\tlanguage = \"english\";\n\t\t}\n\n\t\tulong startAssetID = 0;\n\n\t\t// We need to store asset IDs to make sure we won't get duplicate items\n\t\tHashSet<ulong>? assetIDs = null;\n\n\t\tDictionary<(ulong ClassID, ulong InstanceID), InventoryDescription>? descriptions = null;\n\n\t\tint rateLimitingDelay = (ASF.GlobalConfig?.InventoryLimiterDelay ?? GlobalConfig.DefaultInventoryLimiterDelay) * 1000;","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/JustArchiNET/ArchiSteamFarm/blob/fe57c4129f4ce02d452318cabc525eb49a087255/ArchiSteamFarm/Steam/Integration/ArchiWebHandler.cs#L288-L324","documentation":"When GetInventoryAsync is called with an explicit non-zero steamID, ASF validates that the ID represents an individual Steam account (SteamID.IsIndividualAccount). A clan/group/anon/invalid ID raises a NotSupportedException ('steamID is null!'). This is an input-validation guard before any network call.","triggerScenarios":"Passing a SteamID64 that is a group/clan account, an anonymous ID, a console ID, or otherwise not a type-1 individual account to GetInventoryAsync.","commonSituations":"Passing a group's SteamID instead of a user's; using an ID parsed from the wrong source (e.g. a clan chat ID); malformed/zero-padded ID after string manipulation.","solutions":["Pass only individual-account SteamID64 values (verify on steamid.io that type is 'Individual').","Validate steamID via SteamKit2 SteamID.IsIndividualAccount before calling.","To fetch the bot's own inventory, call with steamID: 0 rather than a group ID.","Sanitize ID inputs from user/external sources before use."],"exampleFix":"// before\nvar inv = bot.ArchiWebHandler.GetInventoryAsync(steamID: groupSteamID);\n// after\nvar sid = new SteamKit2.SteamID(groupSteamID);\nif (!sid.IsIndividualAccount) return;\nvar inv = bot.ArchiWebHandler.GetInventoryAsync(steamID: sid.ConvertToUInt64());","handlingStrategy":"validation","validationCode":"var sid = new SteamKit2.SteamID(steamID);\nif (steamID == 0 || !sid.IsIndividualAccount)\n    throw new ArgumentException(\"steamID must be an individual account\", nameof(steamID));","typeGuard":"static bool IsValidTargetSteamID(ulong steamID) =>\n    steamID != 0 && new SteamKit2.SteamID(steamID).IsIndividualAccount;","tryCatchPattern":"try { await foreach (var a in webHandler.GetInventoryAsync(steamID)) { /* ... */ } }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"steamID\")) {\n    // reject the supplied ID upstream\n}","preventionTips":["Validate SteamID is an individual account before calling.","Pass steamID: 0 to fetch the bot's own inventory.","Sanitize external ID inputs before use."],"tags":["steam","inventory","validation","steamid","input"],"backgroundTag":null,"analyzedSha":"fe57c4129f4ce02d452318cabc525eb49a087255","analyzedAt":"2026-08-13T17:26:20.146Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}