JustArchiNET/ArchiSteamFarm · error · NotSupportedException
steamID is null!
Error message
steamID is null!
What it means
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.
Source
Thrown at ArchiSteamFarm/Steam/Integration/ArchiWebHandler.cs:306
ArgumentOutOfRangeException.ThrowIfZero(contextID);
ArgumentOutOfRangeException.ThrowIfZero(itemsCountPerRequest);
if (steamID == 0) {
if (!Initialized) {
byte connectionTimeout = ASF.GlobalConfig?.ConnectionTimeout ?? GlobalConfig.DefaultConnectionTimeout;
for (byte i = 0; (i < connectionTimeout) && !Initialized && Bot.IsConnectedAndLoggedOn; i++) {
await Task.Delay(1000).ConfigureAwait(false);
}
if (!Initialized) {
throw new HttpRequestException(Strings.WarningFailed);
}
}
steamID = Bot.SteamID;
} else if (!new SteamID(steamID).IsIndividualAccount) {
throw new NotSupportedException(Strings.FormatErrorObjectIsNull(nameof(steamID)));
}
if (ASF.InventorySemaphore == null) {
throw new InvalidOperationException(nameof(ASF.InventorySemaphore));
}
if (string.IsNullOrEmpty(language)) {
language = "english";
}
ulong startAssetID = 0;
// We need to store asset IDs to make sure we won't get duplicate items
HashSet<ulong>? assetIDs = null;
Dictionary<(ulong ClassID, ulong InstanceID), InventoryDescription>? descriptions = null;
int rateLimitingDelay = (ASF.GlobalConfig?.InventoryLimiterDelay ?? GlobalConfig.DefaultInventoryLimiterDelay) * 1000;View on GitHub (pinned to fe57c4129f)
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.
Example fix
// before var inv = bot.ArchiWebHandler.GetInventoryAsync(steamID: groupSteamID); // after var sid = new SteamKit2.SteamID(groupSteamID); if (!sid.IsIndividualAccount) return; var inv = bot.ArchiWebHandler.GetInventoryAsync(steamID: sid.ConvertToUInt64());
Defensive patterns
Strategy: validation
Validate before calling
var sid = new SteamKit2.SteamID(steamID);
if (steamID == 0 || !sid.IsIndividualAccount)
throw new ArgumentException("steamID must be an individual account", nameof(steamID)); Type guard
static bool IsValidTargetSteamID(ulong steamID) =>
steamID != 0 && new SteamKit2.SteamID(steamID).IsIndividualAccount; Try / catch
try { await foreach (var a in webHandler.GetInventoryAsync(steamID)) { /* ... */ } }
catch (NotSupportedException ex) when (ex.Message.Contains("steamID")) {
// reject the supplied ID upstream
} Prevention
- Validate SteamID is an individual account before calling.
- Pass steamID: 0 to fetch the bot's own inventory.
- Sanitize external ID inputs before use.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- SteamID is invalid!
- Received unknown value for {0}, please report this: {1}
- Failed due to error: Client.IsConnected
- Failed due to error: {0}
- response is null!
AI-assisted analysis of JustArchiNET/ArchiSteamFarm@fe57c4129f (2026-08-13).
Data as JSON: /api/errors/bf092a5c2136cfd0.
Report an issue: GitHub.