Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-4053

AbstractTree#updateTree(AjaxRequestTarget target) is invoked even when request is non-ajax

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.0
    • Fix Version/s: 1.5.1
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Wicket 1.5.0

      Description

      I came across an issue when trying to get Brix working in wicket 1.5.
      It occurs when the Tree has: setLinkType(LinkType.REGULAR);

      Caused by: java.lang.IllegalArgumentException: Argument 'target' may not be null.
      at org.apache.wicket.util.lang.Args.notNull(Args.java:39)
      at org.apache.wicket.markup.html.tree.AbstractTree.updateTree(AbstractTree.java:1138)
      at org.apache.wicket.markup.html.tree.LinkIconPanel.onNodeLinkClicked(LinkIconPanel.java:82)
      at org.apache.wicket.markup.html.tree.LinkIconPanel$1.onClick(LinkIconPanel.java:59)
      at org.apache.wicket.markup.html.tree.BaseTree$5.onClick(BaseTree.java:386)
      at org.apache.wicket.markup.html.link.Link.onLinkClicked(Link.java:187)

      I only had a quick search across the wicket codebase to see if this method is called elsewhere

      To fix LinkIconPanel line 82 should be
      if (target != null)

      { tree.updateTree(target); }

      BaseTree - line 294 also calls updateTree(target) with no null check.

        Activity

        Hide
        pete Peter Ertl added a comment -

        all occurences of updateTree(..) with possible null pointers should be fixed now in trunk.

        thanks for reporting !

        Show
        pete Peter Ertl added a comment - all occurences of updateTree(..) with possible null pointers should be fixed now in trunk. thanks for reporting !

          People

          • Assignee:
            pete Peter Ertl
            Reporter:
            jamesmcintosh James McIntosh
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development