Issue #2904 Nullpointer potential in MesoTabular product.

Former-commit-id: e3139396104ee0d4ffc1dea7fd20782d00eb5ade
This commit is contained in:
Dave Hladky 2014-03-17 15:22:42 -05:00
parent 9cf43e7de6
commit 373f052de8

View file

@ -62,6 +62,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* as the ids in source file.
* 11/13/2012 14368 Xiaochuan Required to set alarm time in a quiet time period
* from the last event to new event (new storm come in).
* 03/12/2014 2904 dhladky Check for occasional Null MesoMap.
*
* </pre>
*
@ -216,6 +217,8 @@ public class MesoCycloneTabularProduct extends RadarProduct {
String dazm = null;
String drng = null;
if (mesoMap != null) {
featureVal = (mesoMap.get(RadarConstants.MapValues.MESO_CIRC_ID));
if ((featureVal != null) && !featureVal.equals(BLANK)) {
row.setIdent(featureVal);
@ -228,7 +231,8 @@ public class MesoCycloneTabularProduct extends RadarProduct {
dazm = row.getAzm().toString();
}
featureVal = (mesoMap.get(RadarConstants.MapValues.MESO_AZIMUTH_RANGE));
featureVal = (mesoMap
.get(RadarConstants.MapValues.MESO_AZIMUTH_RANGE));
if ((featureVal != null) && !featureVal.equals(BLANK)) {
row.setRng(new Double(featureVal));
drng = new Double(row.getRng() * ScanUtils.NMI_TO_KM * 1000)
@ -283,7 +287,8 @@ public class MesoCycloneTabularProduct extends RadarProduct {
((DMDTableDataRow) row).setDepth(new Double(depth));
}
featureVal = (mesoMap.get(RadarConstants.MapValues.MESO_DEPTH_PERCENT));
featureVal = (mesoMap
.get(RadarConstants.MapValues.MESO_DEPTH_PERCENT));
if (((featureVal) != null) && !featureVal.equals(BLANK)) {
((DMDTableDataRow) row).setRelDepth(new Double(featureVal));
}
@ -308,15 +313,11 @@ public class MesoCycloneTabularProduct extends RadarProduct {
((DMDTableDataRow) row).setHtMxVr(new Double(featureVal));
}
// coor = RadarRecordUtil
// .getDMDLonLatFromFeatureID((RadarRecord) rec, key);
if ((dazm != null) && (drng != null)) {
coor = RadarRecordUtil
.getAzRangeLatLon((RadarRecord) rec, key,
coor = RadarRecordUtil.getAzRangeLatLon((RadarRecord) rec, key,
((RadarRecord) rec).getSpatialObject().getLat(),
((RadarRecord) rec).getSpatialObject().getLon(),
dazm, drng);
((RadarRecord) rec).getSpatialObject().getLon(), dazm,
drng);
}
if (coor != null) {
@ -325,6 +326,7 @@ public class MesoCycloneTabularProduct extends RadarProduct {
row.setCounty(getCountyBySpatialQuery(coor));
row.setCwa(getCWABySpatialQuery(coor));
}
}
return row;
}