1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 11:32:54 +08:00

Trigger request failure on receiving a null response for a typed APIRequest

This commit is contained in:
Dean Herbert 2024-09-05 01:00:23 +09:00
parent abd74ab41c
commit 6fc60908c0
No known key found for this signature in database

View File

@ -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();
} }