diff --git a/build.gradle b/build.gradle index 304f76b..4103e5e 100644 --- a/build.gradle +++ b/build.gradle @@ -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' diff --git a/src/main/java/jodd/http/HttpBase.java b/src/main/java/jodd/http/HttpBase.java index 463710f..f580ca8 100644 --- a/src/main/java/jodd/http/HttpBase.java +++ b/src/main/java/jodd/http/HttpBase.java @@ -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) {