Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-1059

JSONResponseBuilder parseParameters method cause NPE.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: 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()); }

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: