Skip to content

Commit d09c47d

Browse files
committed
+ OAuthApi with new changes
1 parent 6b2e6bb commit d09c47d

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/main/java/Api/OAuthApi.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,15 @@ private okhttp3.Call postAccessTokenFromAuthCodeValidateBeforeCall(CreateAccessT
111111
public AccessTokenResponse postAccessTokenFromAuthCode(CreateAccessTokenRequest createAccessTokenRequest) throws ApiException {
112112
this.apiClient.setComputationStartTime(System.nanoTime());
113113
ApiResponse<AccessTokenResponse> resp = postAccessTokenFromAuthCodeWithHttpInfo(createAccessTokenRequest);
114-
return resp.getData();
114+
if(resp != null)
115+
{
116+
return resp.getData();
117+
}
118+
else
119+
{
120+
logger.error("CALL TO METHOD 'postAccessTokenFromAuthCode' FAILED DUE TO AN EXCEPTION");
121+
return null;
122+
}
115123
}
116124

117125

@@ -235,7 +243,15 @@ private okhttp3.Call postAccessTokenFromRefreshTokenValidateBeforeCall(CreateAcc
235243
public AccessTokenResponse postAccessTokenFromRefreshToken(CreateAccessTokenRequest createAccessTokenRequest) throws ApiException {
236244
this.apiClient.setComputationStartTime(System.nanoTime());
237245
ApiResponse<AccessTokenResponse> resp = postAccessTokenFromRefreshTokenWithHttpInfo(createAccessTokenRequest);
238-
return resp.getData();
246+
if(resp != null)
247+
{
248+
return resp.getData();
249+
}
250+
else
251+
{
252+
logger.error("CALL TO METHOD 'postAccessTokenFromRefreshToken' FAILED DUE TO AN EXCEPTION");
253+
return null;
254+
}
239255
}
240256

241257

0 commit comments

Comments
 (0)