sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jso...@apache.org
Subject [sis] branch geoapi-4.0 updated: Coverage : fix a null pointer on sample dimension creation when name is undefined
Date Thu, 10 Oct 2019 14:50:13 GMT
This is an automated email from the ASF dual-hosted git repository.

jsorel 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 5c02092  Coverage : fix a null pointer on sample dimension creation when name is
undefined
5c02092 is described below

commit 5c02092fc7c314534defb01c0d472e69ebda058c
Author: jsorel <johann.sorel@geomatys.com>
AuthorDate: Thu Oct 10 16:49:45 2019 +0200

    Coverage : fix a null pointer on sample dimension creation when name is undefined
---
 .../src/main/java/org/apache/sis/coverage/SampleDimension.java      | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/core/sis-feature/src/main/java/org/apache/sis/coverage/SampleDimension.java b/core/sis-feature/src/main/java/org/apache/sis/coverage/SampleDimension.java
index 998ba67..f9e055c 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/coverage/SampleDimension.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/coverage/SampleDimension.java
@@ -980,9 +980,9 @@ public class SampleDimension implements Serializable {
         public SampleDimension build() {
             GenericName name = dimensionName;
 defName:    if (name == null) {
-                for (final Category category : categories) {
-                    if (category.isQuantitative()) {
-                        name = createLocalName(category.name);
+                for (int i = 0; i < count; i++) {
+                    if (categories[i].isQuantitative()) {
+                        name = createLocalName(categories[i].name);
                         break defName;
                     }
                 }


Mime
View raw message