1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:07:44 +08:00

Merge pull request #20899 from peppy/fix-tournament-point-deserialisation

Fix point conversion not using invariant culture
This commit is contained in:
Dan Balasescu 2022-10-24 13:32:48 +09:00 committed by GitHub
commit 83dd295b22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,6 +6,7 @@
using System;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using Newtonsoft.Json;
namespace osu.Game.Tournament
@ -31,7 +32,9 @@ namespace osu.Game.Tournament
Debug.Assert(str != null);
return new PointConverter().ConvertFromString(str) as Point? ?? new Point();
// Null check suppression is required due to .NET standard expecting a non-null context.
// Seems to work fine at a runtime level (and the parameter is nullable in .NET 6+).
return new PointConverter().ConvertFromString(null!, CultureInfo.InvariantCulture, str) as Point? ?? new Point();
}
var point = new Point();