[Mono-bugs] [Bug 54209][Maj] New - this.bool = DateTime.Ticks in DateTime Property

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 11 Feb 2004 11:44:11 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by simon.steele@softel.co.uk.

http://bugzilla.ximian.com/show_bug.cgi?id=54209

--- shadow/54209	2004-02-11 11:44:11.000000000 -0500
+++ shadow/54209.tmp.23912	2004-02-11 11:44:11.000000000 -0500
@@ -0,0 +1,51 @@
+Bug#: 54209
+Product: Mono/Class Libraries
+Version: unspecified
+OS: Debian Woody
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: simon.steele@softel.co.uk               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: this.bool = DateTime.Ticks in DateTime Property
+
+Mono Version: 0.30
+
+Description of Problem: 
+
+When passing in DateTime.Now to a DateTime property on a class, that has 
+code similar to that below in the setter method, a NullReferenceException 
+is thrown:
+
+public DateTime Start
+{
+  get { return _dt; }
+  set { _dt = value; mybool = _dt.ticks != 0; } // < exception here.
+}
+
+Steps to reproduce the problem:
+1. Compile attached .cs file: mcs TestDateTime.cs
+2. Run: mono TestDateTime.exe
+3. See exception.
+
+Actual Results:
+
+Unhandled Exception: System.NullReferenceException: A null value was 
+found where an object instance was required
+in <0x00085> Bug.TestDateTime:set_Start (System.DateTime)
+in <0x00051> Bug.Test:Main (string[])
+
+Expected Results:
+
+<nothing>
+
+How often does this happen? 
+
+Every time.