Skip to content

Commit

Permalink
Removed unnecessary try-catch when attempting to retrieve API version…
Browse files Browse the repository at this point in the history
… header
  • Loading branch information
OrangeAndGreen committed Jul 19, 2024
1 parent 9137590 commit 3c220b1
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,7 @@ public InputStream getResponseStream(Response<ResponseBody> response) throws IOE
}

public String getApiVersion() {
String apiVerison = null;
try {
apiVerison = response.headers().get("x-api-current-version");
} catch(Exception e) {
//Ignore exception if API version header isn't present
}
return apiVerison;
return response != null ? response.headers().get("x-api-current-version") : null;
}

public static RequestBody getPostBody(Multimap<String, String> inputs) {
Expand Down

0 comments on commit 3c220b1

Please sign in to comment.