1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-27 07:09:54 +08: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:
Dean Herbert
2024-09-05 18:31:54 +09:00
committed by GitHub
Unverified
+5
View File
@@ -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();
}