Mercurial > dive4elements > river
changeset 5444:70e0732bd4dd
WaterlevelFacet: Avoid classcastexceptions.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 27 Mar 2013 09:49:04 +0100 |
parents | 3d7e552cc396 |
children | 3c7e7d47939f |
files | flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WaterlevelFacet.java |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WaterlevelFacet.java Tue Mar 26 22:29:55 2013 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WaterlevelFacet.java Wed Mar 27 09:49:04 2013 +0100 @@ -38,7 +38,13 @@ protected WQKms [] getWQKms(CalculationResult res) { if (res.getData() instanceof ExtremeResult) return ((ExtremeResult) res.getData()).getWQKms(); - return (WQKms []) res.getData(); + else if (res.getData() instanceof WQKms[]) { + return (WQKms []) res.getData(); + } + else { + logger.error("WaterlevelFacet got wrong data type " + res.getData()); + return null; + } } /**