Skip to content

Commit 3924fc7

Browse files
authored
Fix duel crash due to failing lookups (ppy#37606)
1 parent a3b8b9a commit 3924fc7

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

osu.Game/Screens/OnlinePlay/Matchmaking/Queue/QueueController.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using osu.Framework.Audio;
77
using osu.Framework.Audio.Sample;
88
using osu.Framework.Bindables;
9-
using osu.Framework.Extensions;
109
using osu.Framework.Extensions.ObjectExtensions;
1110
using osu.Framework.Graphics;
1211
using osu.Framework.Graphics.Colour;
@@ -186,11 +185,17 @@ private void onMatchmakingRoomInvited(MatchmakingRoomInvitationParams invitation
186185

187186
private void onMatchmakingDuelIssued(MatchmakingDuelIssuedParams duel)
188187
{
189-
users.GetUserAsync(duel.UserId)
190-
.ContinueWith(u => Scheduler.Add(() =>
191-
{
192-
notifications?.Post(new DuelNotification(this, u.GetResultSafely()!, duel));
193-
}), TaskContinuationOptions.OnlyOnRanToCompletion);
188+
handleDuelRequestAsync().FireAndForget();
189+
190+
async Task handleDuelRequestAsync()
191+
{
192+
APIUser? user = await users.GetUserAsync(duel.UserId).ConfigureAwait(false);
193+
194+
if (user == null)
195+
return;
196+
197+
Scheduler.Add(() => notifications?.Post(new DuelNotification(this, user, duel)));
198+
}
194199
}
195200

196201
private void onMatchmakingRoomReady(long roomId, string password) => Scheduler.Add(() =>

0 commit comments

Comments
 (0)