mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Fix potential invalid operation exception in SubmittingPlayer
token retrieval
This commit is contained in:
@ -86,16 +86,13 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
// Generally a timeout would not happen here as APIAccess will timeout first.
|
// Generally a timeout would not happen here as APIAccess will timeout first.
|
||||||
if (!tcs.Task.Wait(60000))
|
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;
|
return true;
|
||||||
|
|
||||||
void handleTokenFailure(Exception exception)
|
void handleTokenFailure(Exception exception)
|
||||||
{
|
{
|
||||||
// This method may be invoked multiple times due to the Task.Wait call above.
|
tcs.SetResult(false);
|
||||||
// We only really care about the first error.
|
|
||||||
if (!tcs.TrySetResult(false))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (HandleTokenRetrievalFailure(exception))
|
if (HandleTokenRetrievalFailure(exception))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user