mirror of
https://github.com/ppy/osu
synced 2024-12-18 21:06:38 +00:00
Merge pull request #29695 from peppy/fail-t-request-on-null-response
Trigger request failure on receiving a null response for a typed `APIRequest`
This commit is contained in:
commit
c51503cfee
@ -46,6 +46,9 @@ namespace osu.Game.Online.API
|
||||
Response = ((OsuJsonWebRequest<T>)WebRequest).ResponseObject;
|
||||
Logger.Log($"{GetType().ReadableName()} finished with response size of {WebRequest.ResponseStream.Length:#,0} bytes", LoggingTarget.Network);
|
||||
}
|
||||
|
||||
if (Response == null)
|
||||
TriggerFailure(new ArgumentNullException(nameof(Response)));
|
||||
}
|
||||
|
||||
internal void TriggerSuccess(T result)
|
||||
@ -152,6 +155,8 @@ namespace osu.Game.Online.API
|
||||
|
||||
PostProcess();
|
||||
|
||||
if (isFailing) return;
|
||||
|
||||
TriggerSuccess();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user