1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:07:25 +08:00

Fix potential invalid operation exception in SubmittingPlayer token retrieval

This commit is contained in:
Salman Ahmed 2022-10-17 03:26:28 +03:00
parent 6cb1c308c9
commit ae05f374a2

View File

@ -86,16 +86,13 @@ namespace osu.Game.Screens.Play
// Generally a timeout would not happen here as APIAccess will timeout first.
if (!tcs.Task.Wait(60000))
handleTokenFailure(new InvalidOperationException("Token retrieval timed out (request never run)"));
req.TriggerFailure(new InvalidOperationException("Token retrieval timed out (request never run)"));
return true;
void handleTokenFailure(Exception exception)
{
// This method may be invoked multiple times due to the Task.Wait call above.
// We only really care about the first error.
if (!tcs.TrySetResult(false))
return;
tcs.SetResult(false);
if (HandleTokenRetrievalFailure(exception))
{