mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-16 06:20:34 +00:00
Add another useful json helper
This commit is contained in:
@@ -26,7 +26,6 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Nodes;
|
||||
using ArchiSteamFarm.Core;
|
||||
using ArchiSteamFarm.Helpers.Json;
|
||||
@@ -50,7 +49,7 @@ internal sealed class Bot {
|
||||
throw new InvalidOperationException(nameof(constructor));
|
||||
}
|
||||
|
||||
JsonElement emptyObject = new JsonObject().ToJsonElement();
|
||||
JsonObject emptyObject = new();
|
||||
|
||||
BotConfig? botConfig = emptyObject.ToJsonObject<BotConfig>();
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ internal sealed class MobileAuthenticator {
|
||||
["shared_secret"] = sharedSecret
|
||||
};
|
||||
|
||||
Steam.Security.MobileAuthenticator? result = jsonObject.ToJsonElement().ToJsonObject<Steam.Security.MobileAuthenticator>();
|
||||
Steam.Security.MobileAuthenticator? result = jsonObject.ToJsonObject<Steam.Security.MobileAuthenticator>();
|
||||
|
||||
if (result == null) {
|
||||
throw new InvalidOperationException(nameof(result));
|
||||
|
||||
Reference in New Issue
Block a user