Skip to content

Commit

Permalink
payloadFromResponse() will return null if callBack type == Void becau…
Browse files Browse the repository at this point in the history
…se GsonConverter cannot work with Void type directly and throws JsonIOException (#119)

Co-authored-by: serhii.kobeza <[email protected]>
  • Loading branch information
SerhiiKobezaCapgemini and serhii.kobeza authored Dec 6, 2024
1 parent ac37e29 commit cd1f75e
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ private Call buildCall() {
private T payloadFromResponse(Response response) throws GuardianException {
try {
final Reader reader = response.body().charStream();
if (typeOfT == Void.class) return null;
return converter.parse(typeOfT, reader);
} catch (Exception e) {
throw new GuardianException("Error parsing server response", e);
Expand Down

0 comments on commit cd1f75e

Please sign in to comment.