Mercurial > dive4elements > river
changeset 6362:682a73729fda
Test if artifact in a MINFO artifact to avoid NPE when getting unit data.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Tue, 18 Jun 2013 13:25:27 +0200 |
parents | 01ff5cd6abfa |
children | abed7e091762 |
files | artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadLSGenerator.java |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadLSGenerator.java Tue Jun 18 13:14:51 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadLSGenerator.java Tue Jun 18 13:25:27 2013 +0200 @@ -17,6 +17,7 @@ import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; import org.dive4elements.artifactdatabase.state.Facet; import org.dive4elements.river.artifacts.D4EArtifact; +import org.dive4elements.river.artifacts.MINFOArtifact; import org.dive4elements.river.artifacts.access.RangeAccess; import org.dive4elements.river.artifacts.access.SedimentLoadAccess; import org.dive4elements.river.artifacts.model.FacetTypes; @@ -225,7 +226,7 @@ @Override protected String getDefaultYAxisLabel(int pos) { String label = "default"; - if (pos == YAXIS.L.idx) { + if (pos == YAXIS.L.idx && artifact instanceof MINFOArtifact) { SedimentLoadAccess access = new SedimentLoadAccess(artifact); if (access.getUnit().equals("m3_per_a")) { label = msg(I18N_YAXIS_LABEL_2, I18N_YAXIS_LABEL_DEFAULT_2);