changeset 7626:182f78d5f3eb

BedQualityExporter: Continue/exit early when no results.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 02 Dec 2013 10:47:30 +0100
parents e999a920f0e5
children 467d01a3a483
files artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityExporter.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityExporter.java	Mon Dec 02 10:42:43 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityExporter.java	Mon Dec 02 10:47:30 2013 +0100
@@ -119,6 +119,9 @@
                         loads[k].getDiameter(km);
                 }
                 BedDiameterResult[] beds = results[j].getBedResults();
+                if (beds.length == 0) {
+                    continue;
+                }
                 for (int k = 0; k < beds.length; k++) {
                     // k + 1: shift km column.
                     // j * beds.length: shift periods.
@@ -127,9 +130,6 @@
                     row[ndx] = beds[k].getDiameterCap(km);
                     row[ndx + 1] = beds[k].getDiameterSub(km);
                 }
-                if (beds.length == 0) {
-                    continue;
-                }
                 BedParametersResult[] params = results[j].getParameters();
                 for(int k = 0; k < params.length; k++) {
                     // loads.length + (beds.lenght * 2) * (j + 1): shift bed and bedload columns.

http://dive4elements.wald.intevation.org