ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1532664 - in /ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl: RepositorySerializer.java RepositorySet.java
Date Wed, 16 Oct 2013 07:31:33 GMT
Author: marrs
Date: Wed Oct 16 07:31:32 2013
New Revision: 1532664

URL: http://svn.apache.org/r1532664
Log:
Two bugfixes to properly check for null before starting to read from stream.

Modified:
    ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositorySerializer.java
    ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositorySet.java

Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositorySerializer.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositorySerializer.java?rev=1532664&r1=1532663&r2=1532664&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositorySerializer.java
(original)
+++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositorySerializer.java
Wed Oct 16 07:31:32 2013
@@ -109,7 +109,7 @@ class RepositorySerializer implements Co
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         try {
             Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
-            if (in.available() > 0) {
+            if (in != null && in.available() > 0) {
                 in = new GZIPInputStream(in);
                 m_stream.fromXML(in, this);
             }

Modified: ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositorySet.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositorySet.java?rev=1532664&r1=1532663&r2=1532664&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositorySet.java
(original)
+++ ace/trunk/org.apache.ace.client.repository/src/org/apache/ace/client/repository/impl/RepositorySet.java
Wed Oct 16 07:31:32 2013
@@ -184,7 +184,7 @@ class RepositorySet {
 
     boolean readLocal() throws IOException {
         InputStream input = m_repository.getLocal(false /* fail */);
-        if (input.available() > 0) {
+        if (input != null && input.available() > 0) {
             read(input);
             return true;
         }



Mime
View raw message