changeset 6853:9e81ed565095

Merged.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 19 Aug 2013 10:20:51 +0200
parents d02ad36115c6 (diff) 4937dab5ff7a (current diff)
children 8d98e1825846
files
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/model/CrossSection.java	Fri Aug 16 11:30:07 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/model/CrossSection.java	Mon Aug 19 10:20:51 2013 +0200
@@ -241,11 +241,19 @@
 
         List<Integer> results = sqlQuery.list();
 
-        for (Integer result: results) {
+        if (results.size() >= 1) {
+            Integer result = results.get(0);
             if (result == getId()) {
                 return true;
             }
         }
+        else {
+            logger.warn("No CS found that could be master.");
+        }
+
+        // TODO If there is none, might need a fallback.
+        // Formerly this was the most current CS (issue1157).
+
         return false;
     }
 }

http://dive4elements.wald.intevation.org