1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Return early to avoid updating state and failure count in fail cases

This commit is contained in:
Dean Herbert 2021-08-20 12:11:41 +09:00
parent a6b7ca1a4c
commit da8eba9996

View File

@ -305,11 +305,13 @@ namespace osu.Game.Online.API
{
req.Perform(this);
if (req.CompletionState != APIRequestCompletionState.Completed)
return false;
// we could still be in initialisation, at which point we don't want to say we're Online yet.
if (IsLoggedIn) state.Value = APIState.Online;
failureCount = 0;
return req.CompletionState == APIRequestCompletionState.Completed;
return true;
}
catch (HttpRequestException re)
{