Skip to content

Commit

Permalink
Trigger request failure on receiving a null response for a typed `API…
Browse files Browse the repository at this point in the history
…Request`
  • Loading branch information
peppy committed Sep 4, 2024
1 parent abd74ab commit 6fc6090
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions osu.Game/Online/API/APIRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ protected override void PostProcess()
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)
Expand Down Expand Up @@ -152,6 +155,8 @@ public void Perform()

PostProcess();

if (isFailing) return;

TriggerSuccess();
}

Expand Down

0 comments on commit 6fc6090

Please sign in to comment.