Skip to content

Commit

Permalink
Added null check before reading from the request input stream (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapessi committed Jun 26, 2019
1 parent f252939 commit 1201296
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,9 @@ public void setReadListener(ReadListener readListener) {
@Override
public int read()
throws IOException {
if (bodyStream == null || bodyStream instanceof NullInputStream) {
return -1;
}
int readByte = bodyStream.read();
if (bodyStream.available() == 0 && listener != null) {
listener.onAllDataRead();
Expand Down

0 comments on commit 1201296

Please sign in to comment.