Skip to content
Browse files

Fix null pointer exception when quakeml doesn't include originUncerta…

…inty
  • Loading branch information...
1 parent 6863cf5 commit e25e28fe6be731aac4e61b06024832510331ed84 @jmfee-usgs jmfee-usgs committed Nov 25, 2013
Showing with 5 additions and 8 deletions.
  1. +5 −8 src/gov/usgs/earthquake/event/QuakemlToCubeConverter.java
View
13 src/gov/usgs/earthquake/event/QuakemlToCubeConverter.java
@@ -225,14 +225,11 @@ public CubeEvent convertQuakemlEventMessage(Quakeml message, Event event,
// horizontal uncertainty
OriginUncertainty originUncertainty = origin.getOriginUncertainty();
- if (OriginUncertaintyDescription.HORIZONTAL_UNCERTAINTY
- .equals(originUncertainty.getPreferredDescription())) {
- // TODO: set this regardless of preferred description?
- if (originUncertainty.getHorizontalUncertainty() != null) {
- cubeEvent.setHorizontalError(originUncertainty
- .getHorizontalUncertainty().divide(
- CubeToQuakemlConverter.METERS_PER_KILOMETER));
- }
+ if (originUncertainty != null &&
+ originUncertainty.getHorizontalUncertainty() != null) {
+ cubeEvent.setHorizontalError(originUncertainty
+ .getHorizontalUncertainty().divide(
+ CubeToQuakemlConverter.METERS_PER_KILOMETER));
}
OriginQuality originQuality = origin.getQuality();

0 comments on commit e25e28f

Please sign in to comment.
Something went wrong with that request. Please try again.