Mercurial > dive4elements > river
changeset 4507:976ff4b74b96
QSectorFacet: Guard access to curentKm in context.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 14 Nov 2012 12:26:45 +0100 |
parents | 719680a282e5 |
children | 03b8d10a99c0 |
files | flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/QSectorFacet.java |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/QSectorFacet.java Wed Nov 14 12:25:13 2012 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/QSectorFacet.java Wed Nov 14 12:26:45 2012 +0100 @@ -49,6 +49,11 @@ @Override public Object getData(Artifact artifact, CallContext context) { QSectorArtifact qsectorArtifact = (QSectorArtifact) artifact; + if (qsectorArtifact == null || context == null || + context.getContextValue("currentKm") == null) { + logger.error("No artifact, context or currentKm in QSectorFacet"); + return null; + } double currentKm = ((Double)context.getContextValue("currentKm")).doubleValue(); return qsectorArtifact.getQSectors(currentKm, context);