Skip to content

Fix Response Charset to UTF-8. #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 9, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add null check in case of response.getEntity() is null.
  • Loading branch information
kikutaro committed Aug 4, 2016
commit ff5bb26ee09edf63fecba17fbf0be3fd1c06dd7b
4 changes: 3 additions & 1 deletion src/main/java/com/sendgrid/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ public Response getResponse(CloseableHttpResponse response) throws IOException {
int statusCode = response.getStatusLine().getStatusCode();

try {
responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
if(response.getEntity() != null) {
responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
}
} catch (IOException ex) {
throw ex;
}
Expand Down