Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      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 && ???

        Activity

        Hide
        medgar Malcolm Edgar added a comment -

        Thanks for picking that up Geoff.

        Fix and unit test submitted to SVN, will be available in next release.

        regards Malcolm Edgar

        Show
        medgar Malcolm Edgar added a comment - Thanks for picking that up Geoff. Fix and unit test submitted to SVN, will be available in next release. regards Malcolm Edgar

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development