Tapestry
  1. Tapestry
  2. TAPESTRY-1059

JSONResponseBuilder parseParameters method cause NPE.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.1
    • Fix Version/s: 4.1.1
    • Component/s: Framework
    • Labels:
      None

      Description

      /**

      • Grabs the incoming parameters needed for json responses, most notable the
      • {@link ServiceConstants#UPDATE_PARTS}

        parameter.

      • @param cycle
      • The request cycle to parse from
        */
        protected void parseParameters(IRequestCycle cycle) { Object[] updateParts = cycle .getParameters(ServiceConstants.UPDATE_PARTS); for(int i = 0; i < updateParts.length; i++) _parts.add(updateParts[i].toString()); }

      if my update components is empty or null. it will throw NPE.

      I think should be:
      Object[] updateParts = cycle
      .getParameters(ServiceConstants.UPDATE_PARTS);
      if(updateParts != null)

      { for(int i = 0; i < updateParts.length; i++) _parts.add(updateParts[i].toString()); }

        Activity

        Hide
        Jun Tsai added a comment -

        I'm sorry i forget to select affects version.

        Show
        Jun Tsai added a comment - I'm sorry i forget to select affects version.
        Hide
        Jesse Kuhnert added a comment -

        Fixed, thanks.

        Show
        Jesse Kuhnert added a comment - Fixed, thanks.

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            Jun Tsai
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development