Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-232

DialogDate throws a NullPointerException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • None
    • 2.0 Final
    • admininterface
    • None

      There are circumstances under which the date node does exist but is empty. In this case DialogDate throws a NullPointerException:
      2004-12-05 18:32:07,386 [http-8180-Processor23] DEBUG jsp - Lack of configuration - not able to render dialog control
      java.lang.NullPointerException
      at info.magnolia.cms.gui.dialog.DialogDate.init(DialogDate.java:63)

      Adding a test on null helps:
      if (this.getWebsiteNode()!=null && this.getWebsiteNode().getNodeData(this.getName()).isExist()) {
      Calendar valueCalendar=this.getWebsiteNode().getNodeData(this.getName()).getDate();
      if ( valueCalendar != null )

      { Date valueDate = valueCalendar.getTime(); SimpleDateFormat sdf = new SimpleDateFormat(format); this.setValue(sdf.format(valueDate)); this.setWebsiteNode(null); //workaround so the value is taken... hm, pfusch }

      }

        Acceptance criteria

              pbaerfuss Philipp Bärfuss
              wyser Vinzenz Wyser
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: