Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2550

NPE when passing null arguments and ParamConverterProviders are registered

    Details

      Description

      If ParamConverterProviders are registered, and null arguments are passed to a REST API call, a NullPointerException is thrown in org.jboss.resteasy.client.microprofile.ProxyInvocationHandler.invoke().

      https://github.com/resteasy/Resteasy/blob/master/resteasy-client-microprofile/src/main/java/org/jboss/resteasy/microprofile/client/ProxyInvocationHandler.java

      for (Object arg : args) {
          if (parameterAnnotations[index].length > 0) {
              ParamConverter<?> converter = ((ParamConverterProvider) p)
                  .getConverter(arg.getClass() /** <-- NPE when arg is null **/, 
                  null, parameterAnnotations[index]);
      

        Gliffy Diagrams

          Attachments

          1. bug.zip
            6 kB
          2. request.png
            request.png
            302 kB
          3. response.png
            response.png
            293 kB
          4. TestNull.java
            2 kB

            Activity

              People

              • Assignee:
                jamezp James Perkins
                Reporter:
                JimmyPraet Jimmy Praet
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: