From 8a01a2261277047aad86b2ce7620026150490cd1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 19 Dec 2022 16:41:04 +0900 Subject: [PATCH] Fix two null refrences in `OsuGame` --- osu.Game/OsuGame.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index db521cd379..a0a45e18a8 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -333,7 +333,7 @@ namespace osu.Game /// The link to load. public void HandleLink(LinkDetails link) => Schedule(() => { - string argString = link.Argument.ToString(); + string argString = link.Argument.ToString() ?? string.Empty; switch (link.Action) { @@ -1042,6 +1042,8 @@ namespace osu.Game { if (entry.Level < LogLevel.Important || entry.Target > LoggingTarget.Database) return; + Debug.Assert(entry.Target != null); + const int short_term_display_limit = 3; if (recentLogCount < short_term_display_limit) @@ -1054,7 +1056,7 @@ namespace osu.Game } else if (recentLogCount == short_term_display_limit) { - string logFile = $@"{entry.Target.ToString().ToLowerInvariant()}.log"; + string logFile = $@"{entry.Target.Value.ToString().ToLowerInvariant()}.log"; Schedule(() => Notifications.Post(new SimpleNotification {