Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDiffHeightYearGenerator.java @ 6548:9987c5a8154a
Prevent accessing min element of empty list, repairing BedDiff Year-Diagrams.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 09 Jul 2013 10:28:52 +0200 |
parents | 036b02fc0c81 |
children | e7eb3c4afcf3 |
comparison
equal
deleted
inserted
replaced
6547:455876ac5914 | 6548:9987c5a8154a |
---|---|
101 context.putContextValue("startkm", getXBounds(0).getLower()); | 101 context.putContextValue("startkm", getXBounds(0).getLower()); |
102 context.putContextValue("endkm", getXBounds(0).getUpper()); | 102 context.putContextValue("endkm", getXBounds(0).getUpper()); |
103 } | 103 } |
104 else if (getXBounds(0) == null && getDomainAxisRange() == null) { | 104 else if (getXBounds(0) == null && getDomainAxisRange() == null) { |
105 BedDifferencesResult data = (BedDifferencesResult)bundle.getData(context); | 105 BedDifferencesResult data = (BedDifferencesResult)bundle.getData(context); |
106 context.putContextValue("startkm", data.getKms().min()); | 106 if (data.getKms().size() >= 0) { |
107 context.putContextValue("endkm", data.getKms().max()); | 107 context.putContextValue("startkm", data.getKms().min()); |
108 context.putContextValue("endkm", data.getKms().max()); | |
109 } | |
110 else { | |
111 logger.warn("No data to define start and end km"); | |
112 } | |
108 } | 113 } |
109 else if (getXBounds(0) == null && getDomainAxisRange() != null){ | 114 else if (getXBounds(0) == null && getDomainAxisRange() != null){ |
110 BedDifferencesResult data = (BedDifferencesResult)bundle.getData(context); | 115 BedDifferencesResult data = (BedDifferencesResult)bundle.getData(context); |
111 Bounds b = new DoubleBounds(data.getKms().min(), data.getKms().max()); | 116 Bounds b = new DoubleBounds(data.getKms().min(), data.getKms().max()); |
112 Bounds bounds = | 117 Bounds bounds = |