comparison backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentDensityParser.java @ 6746:d3c609581313 double-precision

Sediment Density parser: avoid NPE when no year is given
author Tom Gottfried <tom.gottfried@intevation.de>
date Fri, 02 Aug 2013 11:51:08 +0200
parents bd437771ea00
children 4b26fd60105f
comparison
equal deleted inserted replaced
6745:bd437771ea00 6746:d3c609581313
175 log.warn("SDP: No km nor density given. Skip line"); 175 log.warn("SDP: No km nor density given. Skip line");
176 return; 176 return;
177 } 177 }
178 178
179 BigDecimal year = null; 179 BigDecimal year = null;
180 try { 180 if (yearString != null) {
181 year = new BigDecimal(nf.parse(yearString).doubleValue()); 181 try {
182 } 182 year = new BigDecimal(nf.parse(yearString).doubleValue());
183 catch (ParseException pe) { 183 }
184 log.warn("Unparseable year string"); 184 catch (ParseException pe) {
185 } 185 log.warn("Unparseable year string");
186 }
187 }
186 188
187 current.addValue(new ImportSedimentDensityValue( 189 current.addValue(new ImportSedimentDensityValue(
188 km, 190 km,
189 shoreOffset, 191 shoreOffset,
190 density, 192 density,

http://dive4elements.wald.intevation.org