[MAGNOLIA-232] DialogDate throws a NullPointerException Created: 06/Dec/04  Updated: 23/Jan/13  Resolved: 17/May/06

Status: Closed
Project: Magnolia
Component/s: admininterface
Affects Version/s: 2.0 Final
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Vinzenz Wyser Assignee: Philipp Bärfuss
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

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 }

}



 Comments   
Comment by Vinzenz Wyser [ 06/Dec/04 ]

originaly reported by Michael Aemisegger

Comment by Philipp Bracher [ 17/May/06 ]

seams to be an old report

Generated at Mon Feb 12 03:15:23 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.