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 Improvement
    • Status: Closed
    • Priority: Trivial 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

        Activity

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development