Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix null pointer exception when quakeml doesn't include originUncertaint... #11

Merged
merged 1 commit into from

2 participants

@jmfee-usgs
Owner

...y

@emartinez-usgs emartinez-usgs merged commit 9157503 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
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();
Something went wrong with that request. Please try again.