hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r939859 - /httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/client/cache/impl/DefaultCacheEntrySerializer.java
Date Fri, 30 Apr 2010 22:43:27 GMT
Author: sebb
Date: Fri Apr 30 22:43:26 2010
New Revision: 939859

URL: http://svn.apache.org/viewvc?rev=939859&view=rev
Log:
Avoid possible NPE

Modified:
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/client/cache/impl/DefaultCacheEntrySerializer.java

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/client/cache/impl/DefaultCacheEntrySerializer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/client/cache/impl/DefaultCacheEntrySerializer.java?rev=939859&r1=939858&r2=939859&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/client/cache/impl/DefaultCacheEntrySerializer.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/client/cache/impl/DefaultCacheEntrySerializer.java
Fri Apr 30 22:43:26 2010
@@ -62,7 +62,9 @@ public class DefaultCacheEntrySerializer
             // oos.writeObject(sheaders);
         } finally {
             try {
-                oos.close();
+                if (oos != null) {
+                    oos.close();
+                }
             } catch (Exception ignore) {
             }
             try {
@@ -95,7 +97,9 @@ public class DefaultCacheEntrySerializer
             throw new RuntimeException(cnfe);
         } finally {
             try {
-                ois.close();
+                if (ois != null) {
+                    ois.close();
+                }
             } catch (Exception ignore) {
             }
             try {



Mime
View raw message