You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@abdera.apache.org by jm...@apache.org on 2008/01/11 00:02:30 UTC

svn commit: r610974 - /incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/util/AutoReleasingInputStream.java

Author: jmsnell
Date: Thu Jan 10 15:02:30 2008
New Revision: 610974

URL: http://svn.apache.org/viewvc?rev=610974&view=rev
Log:
fix NPE caused under certain conditions

Modified:
    incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/util/AutoReleasingInputStream.java

Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/util/AutoReleasingInputStream.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/util/AutoReleasingInputStream.java?rev=610974&r1=610973&r2=610974&view=diff
==============================================================================
--- incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/util/AutoReleasingInputStream.java (original)
+++ incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/util/AutoReleasingInputStream.java Thu Jan 10 15:02:30 2008
@@ -35,6 +35,7 @@
 
   @Override
   public int read() throws IOException {
+    if (this.in == null) return -1;
     try {
       int r = super.read();
       if (r == -1) {
@@ -50,6 +51,7 @@
 
   @Override
   public int read(byte[] b, int off, int len) throws IOException {
+    if (this.in == null) return -1;
     try {
       int r= super.read(b, off, len);
       if (r == -1) {