1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 12:22:56 +08:00

Fix web requests potentially being performed after cancelled

Closes https://github.com/ppy/osu/issues/18524.
This commit is contained in:
Dean Herbert 2022-06-02 14:28:48 +09:00
parent 1af51a2b19
commit eb2d822530

View File

@ -121,8 +121,16 @@ namespace osu.Game.Online.API
if (isFailing) return;
Logger.Log($@"Performing request {this}", LoggingTarget.Network);
WebRequest.Perform();
try
{
Logger.Log($@"Performing request {this}", LoggingTarget.Network);
WebRequest.Perform();
}
catch (OperationCanceledException)
{
// ignore this. internally Perform is running async and the fail state may have changed since
// the last check of `isFailing` above.
}
if (isFailing) return;