Skip to content

Commit 48754d3

Browse files
committed
Fixed potential NPE when a queue returns null in PipeStream. Issue #1246. Reported and contributed by Grégoire Juge.
1 parent f8c51ca commit 48754d3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

build/tmpl/text/changes.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Changes log
77
- Bugs fixed
88
- In IE 10 and seq., request without body are sent with an "undefined" body. Issue #1252.
99
Reported by Etienne Griette.
10-
10+
- Fixed potential NPE when a queue returns null in PipeStream. Issue #1246.
11+
Reported and contributed by Grégoire Juge.
1112
- 2.3.8 (12/10/2016)
1213
- Bugs fixed
1314
- Fixed NullPointerException when requesting a Directory with a query string. Issue #1206.

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

+1-1
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)