Fix solo statistics watcher firing requests for invalid user with id 1

Can happen during login flow (see `APIAccess.attemptConnect()`).
This commit is contained in:
Bartłomiej Dach 2022-12-24 13:28:25 +01:00
parent d6e079a2b4
commit fd9110a61e
No known key found for this signature in database

View File

@ -3,7 +3,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Extensions.ObjectExtensions;
@ -72,11 +71,9 @@ namespace osu.Game.Online.Solo
lastProcessedScoreId = null;
latestStatistics.Clear();
if (!api.IsLoggedIn)
if (localUser == null || localUser.OnlineID <= 1)
return;
Debug.Assert(localUser != null);
var userRequest = new GetUsersRequest(new[] { localUser.OnlineID });
userRequest.Success += response => Schedule(() =>
{