diff --git a/Program.cs b/Program.cs index a3b4d6b..ccb6961 100644 --- a/Program.cs +++ b/Program.cs @@ -25,10 +25,12 @@ var name = Console.ReadLine() ?? ""; var hs = new HighScore { Name = name, Trials = trials }; -List highScores = null; +List? highScores = null; const string FileName = "highscores.json"; if (File.Exists(FileName)) - highScores = JsonSerializer.Deserialize>(File.ReadAllText(FileName)); + highScores = + JsonSerializer.Deserialize>(File.ReadAllText(FileName)) + ?? new List(); if (highScores == null) highScores = new List();