From cd1f75eec7d0747ce6b80c986e09e002fa87ed4a Mon Sep 17 00:00:00 2001 From: SerhiiKobezaCapgemini Date: Fri, 6 Dec 2024 21:47:21 +0100 Subject: [PATCH] payloadFromResponse() will return null if callBack type == Void because GsonConverter cannot work with Void type directly and throws JsonIOException (#119) Co-authored-by: serhii.kobeza --- .../java/com/auth0/android/guardian/sdk/networking/Request.java | 1 + 1 file changed, 1 insertion(+) diff --git a/guardian/src/main/java/com/auth0/android/guardian/sdk/networking/Request.java b/guardian/src/main/java/com/auth0/android/guardian/sdk/networking/Request.java index 898e52b..42b2904 100644 --- a/guardian/src/main/java/com/auth0/android/guardian/sdk/networking/Request.java +++ b/guardian/src/main/java/com/auth0/android/guardian/sdk/networking/Request.java @@ -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);