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

A brain dead implementation of toString() on a custom data object can cause the Required validator to throw a NullPointerExcepton

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 5.0.12
    • 5.0.12
    • tapestry-core
    • None

    Description

      the validate method of the Required validator contains following code line:

      if (value == null || value.toString().equals(""))...

      if the toString method returns null an exception will occur (happened to me accidentally )

      this code line should at least be changed to:

      if (value == null || "".equals(value.toString())... to prevent NPE

      Attachments

        Activity

          People

            hlship Howard Lewis Ship
            kristian Kristian Marinkovic
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment