casting magic

This commit is contained in:
glax 2024-01-17 22:33:05 +01:00
parent 6a28755311
commit bd82a7e0e9
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@
<Authors>Glax</Authors> <Authors>Glax</Authors>
<RepositoryUrl>https://github.com/C9Glax/CShocker</RepositoryUrl> <RepositoryUrl>https://github.com/C9Glax/CShocker</RepositoryUrl>
<RepositoryType>git</RepositoryType> <RepositoryType>git</RepositoryType>
<Version>1.1.8</Version> <Version>1.1.9</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -16,7 +16,7 @@ public class ShockerJsonConverter : JsonConverter
public override object ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer) public override object ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
{ {
JObject jo = JObject.Load(reader); JObject jo = JObject.Load(reader);
ShockerApi? apiType = jo.SelectToken("ApiType")?.Value<ShockerApi>(); ShockerApi? apiType = (ShockerApi?)jo.SelectToken("ApiType")?.Value<byte>();
switch (apiType) switch (apiType)
{ {