Mercurial > dive4elements > river
diff 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 |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/SQRelationAccess.java Thu Oct 17 18:56:44 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/SQRelationAccess.java Fri Oct 18 15:30:44 2013 +0200 @@ -101,7 +101,7 @@ } List<MeasurementStation> candidates = MeasurementStation.getStationsAtKM( getRiverName(), getLocation()); - if (candidates != null) { + if (candidates != null && !candidates.isEmpty()) { // Just take the first one as we only use the name // and that "should" be unique at the location measurementStation = candidates.get(0);