Mercurial > dive4elements > river
changeset 4506:719680a282e5
CrossSectionWaterLineFacet: Guard class cast.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 14 Nov 2012 12:25:13 +0100 |
parents | 6d3426aba65d |
children | 976ff4b74b96 |
files | flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionWaterLineFacet.java |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionWaterLineFacet.java Wed Nov 14 12:23:56 2012 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionWaterLineFacet.java Wed Nov 14 12:25:13 2012 +0100 @@ -71,6 +71,10 @@ if (nextKm == null) nextKm = new Double(-1d); + if (!(artifact instanceof WaterLineArtifact)) { + logger.error("CrossSectionWaterLineFacet needs WaterLineArtifact"); + return new Lines.LineData(new double[][] {}, 0d,0d); + } WaterLineArtifact lineArtifact = (WaterLineArtifact) artifact; if (crossSection != null) {