changeset 8001:5277483044d9 facet-metadata

Fixed NPE when loading folders from datacage.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 03 Jul 2014 11:33:41 +0200
parents 928891df0173
children 4366ec0d8f8f
files artifacts/src/main/java/org/dive4elements/river/exports/process/BedDiffYearProcessor.java artifacts/src/main/java/org/dive4elements/river/exports/process/BedHeightProcessor.java artifacts/src/main/java/org/dive4elements/river/exports/process/BedQualityDensityProcessor.java artifacts/src/main/java/org/dive4elements/river/exports/process/BedQualityDiameterProcessor.java artifacts/src/main/java/org/dive4elements/river/exports/process/BedQualityPorosityProcessor.java artifacts/src/main/java/org/dive4elements/river/exports/process/MiddleBedHeightProcessor.java
diffstat 6 files changed, 23 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/BedDiffYearProcessor.java	Thu Jul 03 11:32:22 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/BedDiffYearProcessor.java	Thu Jul 03 11:33:41 2014 +0200
@@ -50,17 +50,21 @@
             boolean          visible
     ) {
         CallContext context = generator.getCallContext();
-        Object data = bundle.getData(context);
         Map<String, String> metaData =
             bundle.getFacet().getMetaData(bundle.getArtifact(), context);
         yAxisLabel = metaData.get("Y");
+
+        setSubtitleRadius(generator, bundle, context);
+
+        Object data = bundle.getData(context);
+        if (data == null) {
+            return;
+        }
+
         if (!(data instanceof double[][])) {
             logger.error("Can't process " + data.getClass().getName() + " objects");
             return;
         }
-
-        setSubtitleRadius(generator, bundle, context);
-
         double[][] bData = (double[][]) data;
 
         StyledXYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme);
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/BedHeightProcessor.java	Thu Jul 03 11:32:22 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/BedHeightProcessor.java	Thu Jul 03 11:33:41 2014 +0200
@@ -82,6 +82,9 @@
         yAxisLabel = metaData.get("Y");
 
         Object raw = bundle.getData(context);
+        if (raw == null) {
+            return null;
+        }
         if (!(raw instanceof double[][])) {
             logger.error("Unkown datatype: " + raw.getClass().getName());
             return null;
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/BedQualityDensityProcessor.java	Thu Jul 03 11:32:22 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/BedQualityDensityProcessor.java	Thu Jul 03 11:33:41 2014 +0200
@@ -44,6 +44,9 @@
         yAxisLabel = metaData.get("Y");
 
         Object data = bundle.getData(context);
+        if (data == null) {
+            return;
+        }
         if (!(data instanceof double[][])) {
             logger.error("Unknown data type: " + data.getClass().getName());
             return;
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/BedQualityDiameterProcessor.java	Thu Jul 03 11:32:22 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/BedQualityDiameterProcessor.java	Thu Jul 03 11:33:41 2014 +0200
@@ -43,6 +43,9 @@
         series.putMetaData(metaData, bundle.getArtifact(), context);
         yAxisLabel = metaData.get("Y");
         Object data = bundle.getData(context);
+        if (data == null) {
+            return;
+        }
         if (!(data instanceof double[][])) {
             logger.error("Unknown data type: " + data.getClass().getName());
             return;
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/BedQualityPorosityProcessor.java	Thu Jul 03 11:32:22 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/BedQualityPorosityProcessor.java	Thu Jul 03 11:33:41 2014 +0200
@@ -45,6 +45,9 @@
         yAxisLabel = metaData.get("Y");
 
         Object raw = bundle.getData(context);
+        if (raw == null) {
+            return;
+        }
         if (!(raw instanceof double[][])) {
             logger.error("Unknown data type: " + raw.getClass().getName());
             return;
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/MiddleBedHeightProcessor.java	Thu Jul 03 11:32:22 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/MiddleBedHeightProcessor.java	Thu Jul 03 11:33:41 2014 +0200
@@ -51,6 +51,9 @@
         yAxisLabel = metaData.get("Y");
 
         Object raw = bundle.getData(context);
+        if (raw == null) {
+            return;
+        }
         if (!(raw instanceof double[][])) {
             logger.error("Unkonwn data type: " + raw.getClass().getName());
             return;

http://dive4elements.wald.intevation.org