Skip to content

Commit

Permalink
fix NPE on gzip check
Browse files Browse the repository at this point in the history
  • Loading branch information
bvolpato committed Oct 6, 2017
1 parent e916573 commit 291f876
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/brunocvcunha/inutils4j/MyHTTPUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static InputStream getContentStream(String stringUrl) throws MalformedURL


InputStream stream;
if (urlConnection.getContentEncoding().equals("gzip")) {
if (urlConnection.getContentEncoding() != null && urlConnection.getContentEncoding().equals("gzip")) {
stream = new GZIPInputStream(urlConnection.getInputStream());
} else {
stream = urlConnection.getInputStream();
Expand Down

0 comments on commit 291f876

Please sign in to comment.