[Mono-bugs] [Bug 329714] New: ErrorProvider: NRE in ErrorProvider+ErrorProperty. window_Tick

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Oct 1 03:59:54 EDT 2007


https://bugzilla.novell.com/show_bug.cgi?id=329714

           Summary: ErrorProvider: NRE in
                    ErrorProvider+ErrorProperty.window_Tick
           Product: Mono: Class Libraries
           Version: 1.2
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Minor
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at ximian.com
        ReportedBy: andyhume32 at yahoo.co.uk
         QAContact: mono-bugs at ximian.com
          Found By: ---


Repro is the <Custom Dialog> "Loan Application" dialog on sample
/ch03_Dialogs/DialogsSample from the sample code for the book "Windows Forms
2.0 Programming," by Chris Sells and Michael Weinhardt, sources available from
http://www.sellsbrothers.com/writing/wfbook/  When run the current directory
must be the program directory.

Tested on SVN head on Win32.

To reproduce open the <Custom Dialog> "Loan Application" dialog and click on
the 'phone number' textbox and back in the 'name' textbox -- the app wants to
display an error icon due to the missing phone number but crashes.  The
exception is: 
[[

Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object

at ErrorProperty.window_Tick (object,System.EventArgs) [0x00101] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\ErrorProvider.cs:278
at System.Windows.Forms.Timer.OnTick (System.EventArgs) [0x0000b] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Timer.cs:161
at System.Windows.Forms.Timer.FireTick () [0x00000] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Timer.cs:154
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Timer.FireTick ()
<0x00038>
at System.Windows.Forms.XplatUIWin32.GetMessage
(System.Windows.Forms.MSG&,intptr,int,int,bool) [0x00280] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\XplatUIWin32.cs:2063
at System.Windows.Forms.XplatUIWin32.GetMessage
(object,System.Windows.Forms.MSG&,intptr,int,int) [0x00000] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\XplatUIWin32.cs:1957
at System.Windows.Forms.XplatUI.GetMessage
(object,System.Windows.Forms.MSG&,intptr,int,int) [0x00000] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\XplatUI.cs:671
at System.Windows.Forms.Application.RunLoop
(bool,System.Windows.Forms.ApplicationContext) [0x0033b] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Application.cs:832
at System.Windows.Forms.Form.ShowDialog (System.Windows.Forms.IWin32Window)
[0x000f8] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Form.cs:1738
at System.Windows.Forms.Form.ShowDialog () [0x00000] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Form.cs:1663
at (wrapper remoting-invoke-with-check) System.Windows.Forms.Form.ShowDialog ()
<0x00038>
at DialogsSample.MainForm.customDialogButton_Click (object,System.EventArgs)
<0x00044>
at System.Windows.Forms.Control.OnClick (System.EventArgs) [0x0001c] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Control.cs:5651
at System.Windows.Forms.Button.OnClick (System.EventArgs) [0x00024] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Button.cs:104
at System.Windows.Forms.ButtonBase.OnMouseUp
(System.Windows.Forms.MouseEventArgs) [0x00076] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\ButtonBase.cs:616
at System.Windows.Forms.Button.OnMouseUp (System.Windows.Forms.MouseEventArgs)
[0x00000] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Button.cs:126
at System.Windows.Forms.Control.WmLButtonUp (System.Windows.Forms.Message&)
[0x0005c] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Control.cs:5247
at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message&)
[0x0017c] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Control.cs:5000
at System.Windows.Forms.ButtonBase.WndProc (System.Windows.Forms.Message&)
[0x00055] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\ButtonBase.cs:674
at System.Windows.Forms.Button.WndProc (System.Windows.Forms.Message&)
[0x00000] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Button.cs:148
at ControlWindowTarget.OnMessage (System.Windows.Forms.Message&) [0x00000] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Control.cs:225
at ControlNativeWindow.WndProc (System.Windows.Forms.Message&) [0x00000] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Control.cs:206
at System.Windows.Forms.NativeWindow.WndProc
(intptr,System.Windows.Forms.Msg,intptr,intptr) [0x0006a] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\NativeWindow.cs:188
at System.Windows.Forms.XplatUIWin32.InternalWndProc
(intptr,System.Windows.Forms.Msg,intptr,intptr) [0x0002c] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\XplatUIWin32.cs:1882
at (wrapper native-to-managed)
System.Windows.Forms.XplatUIWin32.InternalWndProc
(intptr,System.Windows.Forms.Msg,intptr,intptr) <0x0004d>
at (wrapper managed-to-native)
System.Windows.Forms.XplatUIWin32.Win32DispatchMessage
(System.Windows.Forms.MSG&) <0x00004>
at System.Windows.Forms.XplatUIWin32.DispatchMessage
(System.Windows.Forms.MSG&) [0x00000] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\XplatUIWin32.cs:2077
at System.Windows.Forms.XplatUI.DispatchMessage (System.Windows.Forms.MSG&)
[0x00000] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\XplatUI.cs:551
at System.Windows.Forms.Application.RunLoop
(bool,System.Windows.Forms.ApplicationContext) [0x002e7] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Application.cs:820
at System.Windows.Forms.Application.Run
(System.Windows.Forms.ApplicationContext) [0x00014] in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Application.cs:622
at System.Windows.Forms.Application.Run (System.Windows.Forms.Form) [0x00000]
in
D:\cygwin\usr\src\mono\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Application.cs:610
at DialogsSample.Program.Main () <0x0002c>
]]



This NRE occurs due to window.Parent being null here.  Unfortunately I can't
quite work out the circumstances.  I took the (VB) sample from MSDN
http://msdn2.microsoft.com/en-us/library/system.windows.forms.errorprovider.aspx,
and it works fine.

I compared the two sources, and tried changing the construction to e.g.:

  Me.Components = New System.ComponentModel.Container()
  ' ...
  nameErrorProvider = New ErrorProvider(Me.components)

Still it works, finally I tried adding:
  nameErrorProvider.ContainerControl = Me

Still it works.  So I can't discover what circumstances cause 'parent' to be
null...


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list