changeset 3140:3d456d8bca6e

TimeseriesChartGenerator: Prevent some NPEs flys-artifacts/trunk@4748 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 21 Jun 2012 15:27:57 +0000
parents 5888c4685701
children 3582e87e9171
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/TimeseriesChartGenerator.java
diffstat 2 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Thu Jun 21 15:23:26 2012 +0000
+++ b/flys-artifacts/ChangeLog	Thu Jun 21 15:27:57 2012 +0000
@@ -1,3 +1,9 @@
+2012-06-21	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/exports/TimeseriesChartGenerator.java:
+	  Prevent some NPEs.
+	  !!! This is not a fix for the real problem !!!
+
 2012-06-21	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/model/fixings/FixDeviationFacet.java,
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/TimeseriesChartGenerator.java	Thu Jun 21 15:23:26 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/TimeseriesChartGenerator.java	Thu Jun 21 15:27:57 2012 +0000
@@ -436,7 +436,9 @@
         }
         else {
             logger.debug("No user specified zoom values found!");
-            total.applyBounds(axis, AXIS_SPACE);
+            if (total != null && axis != null) {
+                total.applyBounds(axis, AXIS_SPACE);
+            }
         }
     }
 
@@ -469,7 +471,9 @@
         }
         else {
             logger.debug("No user specified zoom values found!");
-            total.applyBounds(axis, AXIS_SPACE);
+            if (total != null && axis != null) {
+                total.applyBounds(axis, AXIS_SPACE);
+            }
         }
     }
 
@@ -694,6 +698,9 @@
         int count  = plot.getDatasetCount();
         for (int i = 0; i < count; i++) {
             XYDataset data = plot.getDataset(i);
+            if (data == null) {
+                continue;
+            }
             int seriesCount = data.getSeriesCount();
             for (int j = 0; j < seriesCount; j++) {
                 StyledTimeSeries series =

http://dive4elements.wald.intevation.org