1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 21:02:55 +08:00

Merge pull request #7424 from peppy/fix-changelog-overlay-nullref

Fix changelog overlay hard crashing on no internet connection
This commit is contained in:
Dan Balasescu 2020-01-03 14:32:30 +09:00 committed by GitHub
commit 0fd87ced0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -158,7 +158,8 @@ namespace osu.Game.Overlays
private Task initialFetchTask; private Task initialFetchTask;
private void performAfterFetch(Action action) => fetchListing()?.ContinueWith(_ => Schedule(action)); private void performAfterFetch(Action action) => fetchListing()?.ContinueWith(_ =>
Schedule(action), TaskContinuationOptions.OnlyOnRanToCompletion);
private Task fetchListing() private Task fetchListing()
{ {
@ -185,10 +186,10 @@ namespace osu.Game.Overlays
tcs.SetResult(true); tcs.SetResult(true);
}); });
req.Failure += _ => req.Failure += e =>
{ {
initialFetchTask = null; initialFetchTask = null;
tcs.SetResult(false); tcs.SetException(e);
}; };
await API.PerformAsync(req); await API.PerformAsync(req);