You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[WinForms] DataGridView-related API validate state and throw IOE #23529
Selected DataGridView-related API validate object state and throw InvalidOperationException.
Selected API now validate object state and throw InvalidOperationException where previously a NullReferenceException could be thrown, if APIs were invoked without being constructing with a valid Owner.
Throwing InvalidOperationException is inline with the behaviours in .NET Runtime, and provides developers with a better debug experience clearly communicating which argument caused the exception.
Old behavior
The listed API would throw NullReferenceException if invoked with null input arguments.
New behavior
The listed API would throw InvalidOperationException if invoked without having a valid Owner property value (in addition to the existing exceptions).
Reason for change
Throwing InvalidOperationException is inline with the behaviours in .NET Runtime, and provides developers with a better debug experience clearly communicating which argument caused the exception.
Recommended action
Review and, if necessary, update the code to prevent constructing the affected types with Owner as null.
Activity
gewarren commentedon Aug 16, 2021
I'm going to close this issue now. If there are any more IOE changes for .NET 6, please open a new issue.