mirror of
https://github.com/ppy/osu.git
synced 2026-05-13 19:54:15 +08:00
Fix duel crash due to failing lookups (#37606)
This commit is contained in:
committed by
GitHub
Unverified
parent
a3b8b9aee9
commit
3924fc7d86
@@ -6,7 +6,6 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Framework.Extensions.ObjectExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
@@ -186,11 +185,17 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue
|
||||
|
||||
private void onMatchmakingDuelIssued(MatchmakingDuelIssuedParams duel)
|
||||
{
|
||||
users.GetUserAsync(duel.UserId)
|
||||
.ContinueWith(u => Scheduler.Add(() =>
|
||||
{
|
||||
notifications?.Post(new DuelNotification(this, u.GetResultSafely()!, duel));
|
||||
}), TaskContinuationOptions.OnlyOnRanToCompletion);
|
||||
handleDuelRequestAsync().FireAndForget();
|
||||
|
||||
async Task handleDuelRequestAsync()
|
||||
{
|
||||
APIUser? user = await users.GetUserAsync(duel.UserId).ConfigureAwait(false);
|
||||
|
||||
if (user == null)
|
||||
return;
|
||||
|
||||
Scheduler.Add(() => notifications?.Post(new DuelNotification(this, user, duel)));
|
||||
}
|
||||
}
|
||||
|
||||
private void onMatchmakingRoomReady(long roomId, string password) => Scheduler.Add(() =>
|
||||
|
||||
Reference in New Issue
Block a user