mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 08:32:55 +08:00
Trigger request failure on receiving a null response for a typed APIRequest
This commit is contained in:
parent
abd74ab41c
commit
6fc60908c0
@ -46,6 +46,9 @@ namespace osu.Game.Online.API
|
|||||||
Response = ((OsuJsonWebRequest<T>)WebRequest).ResponseObject;
|
Response = ((OsuJsonWebRequest<T>)WebRequest).ResponseObject;
|
||||||
Logger.Log($"{GetType().ReadableName()} finished with response size of {WebRequest.ResponseStream.Length:#,0} bytes", LoggingTarget.Network);
|
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)
|
internal void TriggerSuccess(T result)
|
||||||
@ -152,6 +155,8 @@ namespace osu.Game.Online.API
|
|||||||
|
|
||||||
PostProcess();
|
PostProcess();
|
||||||
|
|
||||||
|
if (isFailing) return;
|
||||||
|
|
||||||
TriggerSuccess();
|
TriggerSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user