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:
commit
0fd87ced0e
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user