commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r674223 - /commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/AbstractCompressor.java
Date Sat, 05 Jul 2008 18:45:40 GMT
Author: bayard
Date: Sat Jul  5 11:45:40 2008
New Revision: 674223

URL: http://svn.apache.org/viewvc?rev=674223&view=rev
Log:
Null protect the stream closing

Modified:
    commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/AbstractCompressor.java

Modified: commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/AbstractCompressor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/AbstractCompressor.java?rev=674223&r1=674222&r2=674223&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/AbstractCompressor.java
(original)
+++ commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/AbstractCompressor.java
Sat Jul  5 11:45:40 2008
@@ -61,8 +61,12 @@
 			throw new CompressException("An IO Exception has occured", e);
 		} finally {
 			try {
-				tempFileOutputStream.close();
-				outputStream.close();
+                if(tempFileOutputStream != null) {
+    				tempFileOutputStream.close();
+                }
+                if(outputStream != null) {
+    				outputStream.close();
+                }
 			} catch (IOException e) {
 				throw new CompressException("An IO Exception occured while closing the streams", e);
 			}



Mime
View raw message