This is an automated email from the ASF dual-hosted git repository.
alexismanin pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git
The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
new 581f8ddd14 fix(Referencing): prevent NPE when searching an identifier
581f8ddd14 is described below
commit 581f8ddd149f11d411120359b8506bb38795fe0e
Author: Alexis Manin <[email protected]>
AuthorDate: Tue Sep 15 08:38:48 2026 +0200
fix(Referencing): prevent NPE when searching an identifier
---
.../main/org/apache/sis/xml/bind/referencing/Code.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/xml/bind/referencing/Code.java
b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/xml/bind/referencing/Code.java
index 25e9956b30..4e08c1bfc3 100644
---
a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/xml/bind/referencing/Code.java
+++
b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/xml/bind/referencing/Code.java
@@ -19,6 +19,7 @@ package org.apache.sis.xml.bind.referencing;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.XmlValue;
import jakarta.xml.bind.annotation.XmlAttribute;
+import org.apache.sis.util.collection.Containers;
import org.opengis.metadata.Identifier;
import org.opengis.metadata.citation.Citation;
import org.apache.sis.util.internal.shared.Constants;
@@ -224,7 +225,7 @@ public final class Code {
if (isEPSG) {
code.codeSpace = Constants.IOGP; // Default
value if we do not find a codespace below.
if (authority != null) {
- for (final Identifier id :
authority.getIdentifiers()) {
+ for (final Identifier id :
Containers.nonNull(authority.getIdentifiers())) {
if
(Constants.EPSG.equalsIgnoreCase(id.getCode())) {
final String cs = id.getCodeSpace();
if (cs != null) {