1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 05:22:54 +08:00

Merge pull request #16630 from peppy/fix-null-mod-json-parse-fail

Fix some score imports failing due to null string attempted to be parsed as json
This commit is contained in:
Dan Balasescu 2022-01-26 23:15:23 +09:00 committed by GitHub
commit bab337591f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,7 +105,7 @@ namespace osu.Game.Scoring
public string ModsJson
{
get => JsonConvert.SerializeObject(APIMods);
set => APIMods = JsonConvert.DeserializeObject<APIMod[]>(value);
set => APIMods = !string.IsNullOrEmpty(value) ? JsonConvert.DeserializeObject<APIMod[]>(value) : Array.Empty<APIMod>();
}
[NotMapped]