xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mrgla...@apache.org
Subject svn commit: r652698 - /xerces/java/trunk/src/org/apache/xerces/dom/NamedNodeMapImpl.java
Date Thu, 01 May 2008 22:38:53 GMT
Author: mrglavas
Date: Thu May  1 15:38:53 2008
New Revision: 652698

URL: http://svn.apache.org/viewvc?rev=652698&view=rev
Log:
Fixing a potential NPE.

Modified:
    xerces/java/trunk/src/org/apache/xerces/dom/NamedNodeMapImpl.java

Modified: xerces/java/trunk/src/org/apache/xerces/dom/NamedNodeMapImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/dom/NamedNodeMapImpl.java?rev=652698&r1=652697&r2=652698&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/dom/NamedNodeMapImpl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/dom/NamedNodeMapImpl.java Thu May  1 15:38:53
2008
@@ -604,13 +604,17 @@
     private void readObject(ObjectInputStream in)
         throws IOException, ClassNotFoundException {
         in.defaultReadObject();
-        nodes = new ArrayList(nodes);
+        if (nodes != null) {
+            nodes = new ArrayList(nodes);
+        }
     }
 
     private void writeObject(ObjectOutputStream out) throws IOException {
         List oldNodes = this.nodes;
         try {
-            this.nodes = new Vector(oldNodes);
+            if (oldNodes != null) {
+                this.nodes = new Vector(oldNodes);
+            }
             out.defaultWriteObject();
         }
         // If the write fails for some reason ensure 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org


Mime
View raw message