Mercurial > dive4elements > river
changeset 5415:5bac3e75f59c
WaterlevelSelectState: Avoid npe with extreme results.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 26 Mar 2013 09:40:05 +0100 |
parents | 1efe382d8668 |
children | 4ee97d914501 |
files | flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WaterlevelSelectState.java |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WaterlevelSelectState.java Mon Mar 25 19:53:35 2013 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WaterlevelSelectState.java Tue Mar 26 09:40:05 2013 +0100 @@ -15,6 +15,7 @@ import de.intevation.flys.artifacts.FLYSArtifact; import de.intevation.flys.artifacts.model.CalculationResult; import de.intevation.flys.artifacts.model.WQKms; +import de.intevation.flys.artifacts.model.extreme.ExtremeResult; import de.intevation.flys.artifacts.resources.Resources; import de.intevation.flys.utils.FLYSUtils; import de.intevation.flys.utils.StringUtil; @@ -123,7 +124,14 @@ ComputeType.ADVANCE, false); - WQKms[] wqkms = (WQKms[]) rawData.getData(); + WQKms[] wqkms; + + if (rawData.getData() instanceof ExtremeResult) { + wqkms = ((ExtremeResult) rawData.getData()).getWQKms(); + } + else { + wqkms = (WQKms[]) rawData.getData(); + } int idx = -1; try {