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

NPE when passing null arguments and ParamConverterProviders are registered

    XMLWordPrintable

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]);
      

      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

        Issue Links

          Activity

            Public project attachment banner

              context keys: [headless, issue, helper, isAsynchronousRequest, project, action, user]
              current Project key: RESTEASY

              People

                jperkins-rhn James Perkins
                jpraet Jimmy Praet (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: