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

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 5.0.12
    • Fix Version/s: 5.0.12
    • Component/s: tapestry-core
    • Labels:
      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

            • Assignee:
              hlship Howard M. Lewis Ship
              Reporter:
              kristian Kristian Marinkovic
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: