mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 22:20:52 +00:00
Fix parsing tags in GetActiveTradeOffers (#2060)
* Fix parsing tags in GetActiveTradeOffers * Accept empty values in Tag constructor * Throw on null value in constructor * Fix mindless copypaste
This commit is contained in:
@@ -1527,7 +1527,8 @@ namespace ArchiSteamFarm {
|
||||
|
||||
string? value = tag["internal_name"].AsString();
|
||||
|
||||
if (string.IsNullOrEmpty(value)) {
|
||||
// Apparently, name can be empty, but not null
|
||||
if (value == null) {
|
||||
Bot.ArchiLogger.LogNullError(nameof(value));
|
||||
|
||||
return null;
|
||||
|
||||
@@ -261,7 +261,7 @@ namespace ArchiSteamFarm.Json {
|
||||
|
||||
internal Tag(string identifier, string value) {
|
||||
Identifier = !string.IsNullOrEmpty(identifier) ? identifier : throw new ArgumentNullException(nameof(identifier));
|
||||
Value = !string.IsNullOrEmpty(value) ? value : throw new ArgumentNullException(nameof(value));
|
||||
Value = value ?? throw new ArgumentNullException(nameof(value));
|
||||
}
|
||||
|
||||
[JsonConstructor]
|
||||
|
||||
Reference in New Issue
Block a user