sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1615131 - /sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java
Date Fri, 01 Aug 2014 15:08:54 GMT
Author: desruisseaux
Date: Fri Aug  1 15:08:53 2014
New Revision: 1615131

URL: http://svn.apache.org/r1615131
Log:
Fixed a NullPointerException.

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java?rev=1615131&r1=1615130&r2=1615131&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java
[UTF-8] Fri Aug  1 15:08:53 2014
@@ -18,6 +18,7 @@ package org.apache.sis.metadata.iso.iden
 
 import java.util.Iterator;
 import java.util.ArrayList;
+import java.util.Collection;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
@@ -157,9 +158,12 @@ public class DefaultAggregateInformation
      */
     static Identifier getAggregateDataSetIdentifier(final Citation name) {
         if (name != null) {
-            final Iterator<? extends Identifier> it = name.getIdentifiers().iterator();
-            if (it.hasNext()) {
-                return it.next();
+            final Collection<? extends Identifier> names = name.getIdentifiers();
+            if (names != null) { // May be null on XML marshalling.
+                final Iterator<? extends Identifier> it = names.iterator();
+                if (it.hasNext()) {
+                    return it.next();
+                }
             }
         }
         return null;



Mime
View raw message