Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComboBox initialization/reinitialization fails with NullReferenceException #2432

Closed
M-Lipin opened this issue Nov 26, 2019 · 0 comments · Fixed by #2449
Assignees
Labels
Milestone

Comments

@M-Lipin
Copy link
Member

@M-Lipin M-Lipin commented Nov 26, 2019

  • .NET Core Version: 3.0
  • Have you experienced this same bug with .NET Framework?: Yes

Problem description:
The issue is that the multi-form desktop application or application with complex control appearance behavior may fail with the error caused by NullReference which has ComboBox's origin. ComboBox initializes successfully and the issue does not reproduce in case this is shown initially on the forms and is not recreated while app lifecycle.

Actual behavior:
NullReferenceException and application crash:

System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Windows.Forms.ComboBox.WmParentNotify(Message& m)
   at System.Windows.Forms.ComboBox.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Expected behavior:
No error.

Minimal repro:
Create the app with hidden dialog form and ComboBox on this form.
Start the app, trigger dialog form initialization and reinitialization without dialog showing.
Observe the error.

DevDiv issue: https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1022943

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.