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 [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=78250 --- shadow/78250 2006-04-30 21:27:44.000000000 -0400 +++ shadow/78250.tmp.7891 2006-04-30 21:27:44.000000000 -0400 @@ -0,0 +1,57 @@ +Bug#: 78250 +Product: Mono: Class Libraries +Version: unspecified +OS: All +OS Details: +Status: NEW +Resolution: +Severity: +Priority: Minor +Component: Windows.Forms +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: Setting the "Text" property of the "System.Windows.Forms.MenuItem" class to null causes an exception. + +Description of Problem: +Setting the "Text" property of the "System.Windows.Forms.MenuItem" class to +null causes an exception. + +Steps to reproduce the problem: +Compile the following with "mcs Test.cs -r:System.Windows.Forms.dll": +//Code starts here +class MenuItemTextNullTest { + static void Main() { + (new System.Windows.Forms.MenuItem()).Text = null; + } +} +//Code ends here +Run the resulting executable. + +Actual Results: +Unhandled Exception: System.NullReferenceException: Object reference not +set to an instance of an object +in <0x00010> System.Windows.Forms.MenuItem:ProcessMnemonic () +in <0x00040> System.Windows.Forms.MenuItem:set_Text (System.String value) +in (wrapper remoting-invoke-with-check) System.Windows.Forms.MenuItem: +set_Text (string) +in <0x00023> MenuItemTextNullTest:Main () + +Expected Results: +No output (no exceptions). + +How often does this happen? +Allways. + +Additional Information: +The "Text" property of the "MenuItem" class in the "System.Windows.Forms" +namespace ("System.Windows.Forms.dll" assembly) sets the "text" field to +the value it is assigned ant calls the "ProcessMnemonic" method which calls +the "Lenght" property on the "text" Field. If the value that is assigned to +the "Text" property is null, an exception is thrown. +On Microsoft .NET Framework, this does not happen. +A possible correction would be to check for null before calling any +instance members of an object. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
