Skip to content
Prev Previous commit
Next Next commit
fixed NPE while testing the TLP bundle spec
  • Loading branch information
anlklsim committed May 16, 2019
commit c6da5d5994eb2940b8ffcad820c4c9b19c37eb5b
4 changes: 2 additions & 2 deletions src/main/java/io/digitalstate/stix/json/StixParsers.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public static BundleObject parseBundle(String bundleJsonString) throws IOExcepti
try {
return getJsonMapper().readValue(bundleJsonString, BundleObject.class);
} catch (IOException ex) {
if (ValidationException.class.isAssignableFrom(ex.getCause().getClass())) {
if (ex.getCause() != null && ValidationException.class.isAssignableFrom(ex.getCause().getClass())) {
throw new StixParserValidationException((ValidationException) ex.getCause());
} else {
throw ex;
Expand All @@ -130,7 +130,7 @@ public static BundleableObject parseObject(String objectJsonString) throws IOExc
try {
return getJsonMapper().readValue(objectJsonString, BundleableObject.class);
} catch (IOException ex) {
if (ValidationException.class.isAssignableFrom(ex.getCause().getClass())) {
if (ex.getCause() != null && ValidationException.class.isAssignableFrom(ex.getCause().getClass())) {
throw new StixParserValidationException((ValidationException) ex.getCause());
} else {
throw ex;
Expand Down