Misc code improvements

This commit is contained in:
JustArchi 2020-12-05 20:30:15 +01:00
parent 6265aa7271
commit 4e190b7dfd
3 changed files with 4 additions and 4 deletions

View file

@ -55,7 +55,7 @@ namespace ArchiSteamFarm.CustomPlugins.ExamplePlugin {
private sealed class MeowResponse {
#pragma warning disable 649
[JsonProperty(PropertyName = "file", Required = Required.Always)]
internal readonly string? Link;
internal readonly string Link = "";
#pragma warning restore 649
[JsonConstructor]

View file

@ -27,7 +27,7 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
internal sealed class ResponseData {
#pragma warning disable 649
[JsonProperty(PropertyName = "data", Required = Required.Always)]
internal readonly InternalData? Data;
internal readonly InternalData Data = new();
#pragma warning restore 649
#pragma warning disable 649
@ -55,7 +55,7 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
#pragma warning restore 649
[JsonConstructor]
private InternalData() { }
internal InternalData() { }
}
}
}

View file

@ -460,7 +460,7 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper {
WebBrowser.ObjectResponse<ResponseData>? response = await ASF.WebBrowser.UrlPostToJsonObject<ResponseData, RequestData>(request, data: requestData, requestOptions: WebBrowser.ERequestOptions.ReturnClientErrors).ConfigureAwait(false);
if ((response?.Content?.Data == null) || response.StatusCode.IsClientErrorCode()) {
if ((response?.Content == null) || response.StatusCode.IsClientErrorCode()) {
ASF.ArchiLogger.LogGenericWarning(Strings.WarningFailed);
#if NETFRAMEWORK