Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1043

PropertyDisplayBlocks causes NullPointerException when property of type Calendar is null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.2.0
    • 5.2.0
    • tapestry-core
    • None

    Description

      Using a Bean Display Grid with a bean with a null calendar throws a null pointer exception.

      org.apache.tapestry5.corelib.pages.PropertyDisplayBlocks.getCalendarDate(PropertyDisplayBlocks.java:56)

      Fix is trivial, simple check that the value is not null before calling getTime().

      public Date getCalendarDate()
      {
      Calendar calendar = (Calendar) context.getPropertyValue();
      if (calendar!=null)

      { return calendar.getTime(); }

      return null;
      }

      Attachments

        Activity

          People

            igor.drobiazko Igor Drobiazko
            obastard Pierce Wetter
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: