comparison flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java @ 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
parents 0aa42c9d58e9
children e8a4d2fd25cc
comparison
equal deleted inserted replaced
4375:532272d9f2e0 4376:3c8964855270
1175 } 1175 }
1176 1176
1177 YAxisWalker walker = getYAxisWalker(); 1177 YAxisWalker walker = getYAxisWalker();
1178 1178
1179 AxisSection as = chartSettings.getAxisSection(walker.getId(pos)); 1179 AxisSection as = chartSettings.getAxisSection(walker.getId(pos));
1180 if (as == null) {
1181 return DEFAULT_FONT_SIZE;
1182 }
1180 Integer fontSize = as.getFontSize(); 1183 Integer fontSize = as.getFontSize();
1181 1184
1182 return fontSize != null ? fontSize : DEFAULT_FONT_SIZE; 1185 return fontSize != null ? fontSize : DEFAULT_FONT_SIZE;
1183 } 1186 }
1184 1187
1248 if (chartSettings == null) { 1251 if (chartSettings == null) {
1249 return null; 1252 return null;
1250 } 1253 }
1251 1254
1252 AxisSection as = chartSettings.getAxisSection(axisId); 1255 AxisSection as = chartSettings.getAxisSection(axisId);
1256
1257 if (as == null) {
1258 return null;
1259 }
1260
1253 Boolean fixed = as.isFixed(); 1261 Boolean fixed = as.isFixed();
1254 1262
1255 if (fixed != null && fixed) { 1263 if (fixed != null && fixed) {
1256 Double upper = as.getUpperRange(); 1264 Double upper = as.getUpperRange();
1257 Double lower = as.getLowerRange(); 1265 Double lower = as.getLowerRange();

http://dive4elements.wald.intevation.org