Skip to content

Commit

Permalink
Fix the null returned from read()
Browse files Browse the repository at this point in the history
  • Loading branch information
igr committed Oct 15, 2020
1 parent 38bba41 commit f8475c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ repositories {
}

group = 'org.jodd'
//version = '6.0.0.' + timestamp() + "-SNAPSHOT"
version = '6.0.2'
version = '6.0.3.' + timestamp() + "-SNAPSHOT"
//version = '6.0.2'

rootProject.description = 'Jodd HTTP Client'

Expand Down
14 changes: 10 additions & 4 deletions src/main/java/jodd/http/HttpBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -1003,10 +1003,16 @@ protected void readBody(final BufferedReader reader) {
final String line = reader.readLine();

final int len;
try {
len = Integer.parseInt(line, 16);
} catch (final NumberFormatException nfex) {
throw new HttpException("Invalid chunk length: " + line);

if (line != null) {
try {
len = Integer.parseInt(line, 16);
} catch (final NumberFormatException nfex) {
throw new HttpException("Invalid chunk length: " + line);
}
}
else {
len = 0;
}

if (len > 0) {
Expand Down

0 comments on commit f8475c7

Please sign in to comment.