Skip to content


Subversion checkout URL

You can clone with
Download ZIP


NPE in DefaultConverter's and JacksonConverter's toRepresentation() if Variant target is null #567

adennie opened this Issue · 0 comments

2 participants


When provided a null Variant target parameter as input, the score(Object source, Variant target, Resource resource) method of DefaultConverter returns a positive number if source is an "instanceof" String or File or Form or InputStream or Reader or Representation or Serializable.

However, if the ConverterService then invokes toRepresentation(), passing the same source and target Variant (null), it will generate an NPE if the source is a String, File, InputStream, Reader, or Serializable, because in each of those cases toRepresentation() will call target.getMediaType().

An analogous issue exists in JacksonConverter.

@jlouvel jlouvel modified the milestone: Unplanned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.