Skip to content

Commit ea2feee

Browse files
author
Aytackydln
committed
fix culture variant json parsing, tested this time
1 parent 435c9e7 commit ea2feee

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Project-Aurora/Project-Aurora/Utils/Json/TypeAnnotatedObjectConverter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public override void WriteJson(JsonWriter writer, object? value, JsonSerializer
6565
case JsonToken.StartObject:
6666
return serializer.Deserialize(valueReader, type);
6767
default:
68-
var s = value.ToString();
68+
var s = value is JValue jValue ? jValue.ToString(CultureInfo.InvariantCulture) : value.ToString();
6969
if (type == typeof(bool) || type == typeof(Color))
7070
{
7171
var colorString = value.ToString();
@@ -117,7 +117,7 @@ public override void WriteJson(JsonWriter writer, object? value, JsonSerializer
117117
case JsonToken.Null:
118118
return existingValue;
119119
}
120-
120+
121121
return JsonConvert.DeserializeObject(json, objectType) ?? existingValue;
122122
}
123123
}

0 commit comments

Comments
 (0)