diff --git a/modules/org.restlet/src/org/restlet/engine/io/PipeStream.java b/modules/org.restlet/src/org/restlet/engine/io/PipeStream.java index 97757f049e..903e67d9c5 100644 --- a/modules/org.restlet/src/org/restlet/engine/io/PipeStream.java +++ b/modules/org.restlet/src/org/restlet/engine/io/PipeStream.java @@ -69,12 +69,12 @@ public int read() throws IOException { final Integer value = queue.poll(QUEUE_TIMEOUT, TimeUnit.SECONDS); - this.endReached = (value == -1); if (value == null) { throw new IOException( "Timeout while reading from the queue-based input stream"); } else { + this.endReached = (value == -1); return value.intValue(); } } catch (InterruptedException ie) {