Skip to content

Commit f26c331

Browse files
authored
Merge pull request #1246 from runmyprocess/master
Fix NPE if queue returns null in PipeStream
2 parents 81c2f9f + 5cb04da commit f26c331

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/org.restlet/src/org/restlet/engine/io/PipeStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ public int read() throws IOException {
6969

7070
final Integer value = queue.poll(QUEUE_TIMEOUT,
7171
TimeUnit.SECONDS);
72-
this.endReached = (value == -1);
7372

7473
if (value == null) {
7574
throw new IOException(
7675
"Timeout while reading from the queue-based input stream");
7776
} else {
77+
this.endReached = (value == -1);
7878
return value.intValue();
7979
}
8080
} catch (InterruptedException ie) {

0 commit comments

Comments
 (0)