Mercurial > dive4elements > river
changeset 4376:3c8964855270
Avoid NullPointerExceptions if no settings are available
Don't fail with a NullPointerExceptions if no setting for the axis is available.
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Fri, 02 Nov 2012 15:41:52 +0100 (2012-11-02) |
parents | 532272d9f2e0 |
children | 512a3af69e18 |
files | flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java Fri Nov 02 15:38:08 2012 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java Fri Nov 02 15:41:52 2012 +0100 @@ -1177,6 +1177,9 @@ YAxisWalker walker = getYAxisWalker(); AxisSection as = chartSettings.getAxisSection(walker.getId(pos)); + if (as == null) { + return DEFAULT_FONT_SIZE; + } Integer fontSize = as.getFontSize(); return fontSize != null ? fontSize : DEFAULT_FONT_SIZE; @@ -1250,6 +1253,11 @@ } AxisSection as = chartSettings.getAxisSection(axisId); + + if (as == null) { + return null; + } + Boolean fixed = as.isFixed(); if (fixed != null && fixed) {