comparison artifacts/src/main/java/org/dive4elements/river/artifacts/access/SQRelationAccess.java @ 7380:d8d0caaf60a2

(issue1071) Handle the case where no MeasurementStation exists Fixes SQRelation Export at the Oder.
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 18 Oct 2013 15:30:44 +0200
parents a56fe3bc6700
children 17db08570637
comparison
equal deleted inserted replaced
7379:e07dc8854a8f 7380:d8d0caaf60a2
99 if (measurementStation != null) { 99 if (measurementStation != null) {
100 return measurementStation; 100 return measurementStation;
101 } 101 }
102 List<MeasurementStation> candidates = MeasurementStation.getStationsAtKM( 102 List<MeasurementStation> candidates = MeasurementStation.getStationsAtKM(
103 getRiverName(), getLocation()); 103 getRiverName(), getLocation());
104 if (candidates != null) { 104 if (candidates != null && !candidates.isEmpty()) {
105 // Just take the first one as we only use the name 105 // Just take the first one as we only use the name
106 // and that "should" be unique at the location 106 // and that "should" be unique at the location
107 measurementStation = candidates.get(0); 107 measurementStation = candidates.get(0);
108 } 108 }
109 109

http://dive4elements.wald.intevation.org