Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix point conversion not using invariant culture #20899

Merged
merged 1 commit into from
Oct 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion osu.Game.Tournament/JsonPointConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using Newtonsoft.Json;

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

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();
Expand Down