From f80a30cba453f8fd53c2fec13326e3e14f846334 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 30 Nov 2018 18:52:31 +0900 Subject: [PATCH] Fix null being serialized --- osu.Game/Scoring/ScoreInfo.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/osu.Game/Scoring/ScoreInfo.cs b/osu.Game/Scoring/ScoreInfo.cs index 07f1181a69..1ca62471f4 100644 --- a/osu.Game/Scoring/ScoreInfo.cs +++ b/osu.Game/Scoring/ScoreInfo.cs @@ -44,7 +44,8 @@ namespace osu.Game.Scoring { get { - if (mods != null) return mods; + if (mods != null) + return mods; if (modsJson == null) return Array.Empty(); @@ -65,7 +66,16 @@ namespace osu.Game.Scoring [Column("Mods")] public string ModsJson { - get => modsJson ?? (modsJson = JsonConvert.SerializeObject(mods)); + get + { + if (modsJson != null) + return modsJson; + + if (mods == null) + return null; + + return modsJson = JsonConvert.SerializeObject(mods); + } set { modsJson = value;