Skip to content

Commit 83dd295

Browse files
authored
Merge pull request #20899 from peppy/fix-tournament-point-deserialisation
Fix point conversion not using invariant culture
2 parents 4ad669e + 889c297 commit 83dd295

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

osu.Game.Tournament/JsonPointConverter.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System;
77
using System.Diagnostics;
88
using System.Drawing;
9+
using System.Globalization;
910
using Newtonsoft.Json;
1011

1112
namespace osu.Game.Tournament
@@ -31,7 +32,9 @@ public override Point ReadJson(JsonReader reader, Type objectType, Point existin
3132

3233
Debug.Assert(str != null);
3334

34-
return new PointConverter().ConvertFromString(str) as Point? ?? new Point();
35+
// Null check suppression is required due to .NET standard expecting a non-null context.
36+
// Seems to work fine at a runtime level (and the parameter is nullable in .NET 6+).
37+
return new PointConverter().ConvertFromString(null!, CultureInfo.InvariantCulture, str) as Point? ?? new Point();
3538
}
3639

3740
var point = new Point();

0 commit comments

Comments
 (0)