Skip to content

Commit

Permalink
more precise detection of the "null to primitive assignment" XStream …
Browse files Browse the repository at this point in the history
…error.
  • Loading branch information
mgurov committed Jan 11, 2014
1 parent 7c7646a commit 7e4a3fe
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ private <T> List<T> toListOfComplexType(DataTable dataTable, Class<T> itemType)
} catch (AbstractReflectionConverter.DuplicateFieldException e) {
throw new CucumberException(e.getShortMessage());
} catch (ConversionException e) {
throw new CucumberException(String.format("Can't assign null value to one of the primitive fields in %s. Please use boxed types.", e.get("class")));
if (e.getCause() instanceof NullPointerException) {
throw new CucumberException(String.format("Can't assign null value to one of the primitive fields in %s. Please use boxed types.", e.get("class")));
} else {
throw e;
}
}
}

Expand Down

0 comments on commit 7e4a3fe

Please sign in to comment.