sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1620289 - /sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/LegacyTelephones.java
Date Mon, 25 Aug 2014 10:10:50 GMT
Author: desruisseaux
Date: Mon Aug 25 10:10:50 2014
New Revision: 1620289

URL: http://svn.apache.org/r1620289
Log:
Fixed a NullPointerException at unmarshalling time.

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

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/LegacyTelephones.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/LegacyTelephones.java?rev=1620289&r1=1620288&r2=1620289&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/LegacyTelephones.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/LegacyTelephones.java
[UTF-8] Mon Aug 25 10:10:50 2014
@@ -21,7 +21,6 @@ import java.util.Iterator;
 import org.opengis.metadata.citation.Telephone;
 import org.opengis.metadata.citation.TelephoneType;
 import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
-import org.apache.sis.util.ArgumentChecks;
 
 
 /**
@@ -99,7 +98,9 @@ final class LegacyTelephones extends Leg
      */
     @Override
     public boolean add(final String value) {
-        ArgumentChecks.ensureNonNull("value", value);
+        if (value == null || value.isEmpty()) { // Null value happen with empty XML elements
like <gco:CharacterString/>
+            return false;
+        }
         final Iterator<Telephone> it = elements.iterator();
         if (it.hasNext()) {
             final Telephone telephone = it.next();



Mime
View raw message