1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 04:02:57 +08:00

Ensure token retrieval failure logic only runs once

This commit is contained in:
Dean Herbert 2022-10-03 17:29:46 +09:00
parent c4dd23ed15
commit 65369e96eb

View File

@ -92,6 +92,11 @@ namespace osu.Game.Screens.Play
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;
if (HandleTokenRetrievalFailure(exception))
{
if (string.IsNullOrEmpty(exception.Message))
@ -111,8 +116,6 @@ namespace osu.Game.Screens.Play
// In the future, this should be visible to the user in some way.
Logger.Log($"Score submission token retrieval failed ({exception.Message})");
}
tcs.SetResult(false);
}
}