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
commit c51503cfee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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