Uploaded image for project: 'Click'
  1. Click
  2. CLK-121

NPE in DateField

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • core
    • None

    Description

      The following code in DateField is causing exceptions for me:

      /**

      • Return the field Date value, or null if value was empty or a parsing
      • error occured.
        *
      • @return the field Date value
        */
        public Date getDate() {
        if (value != null || value.length() > 0) {
        try { Date date = getDateFormat().parse(value); return new Date( date.getTime()); }

        catch (ParseException pe)

        { return null; }

      } else

      { return null; }

      }

      The first line is causing a NPE if value = null.... the || should be a && ???

      Attachments

        Activity

          People

            medgar Malcolm Edgar
            ghopson Geoff Hopson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: