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

[WinForms] API validate input parameters and throw ANE #17085

Closed
27 tasks done
RussKie opened this issue Feb 14, 2020 · 6 comments
Closed
27 tasks done

[WinForms] API validate input parameters and throw ANE #17085

RussKie opened this issue Feb 14, 2020 · 6 comments
Assignees
Labels
breaking-change Indicates a .NET Core breaking change 🏁 Release: .NET 5 Work items for the .NET 5 release winforms/subsvc

Comments

@RussKie
Copy link
Member

RussKie commented Feb 14, 2020

Selected API validate input parameters and throw ArgumentNullException.

Selected API now validate input parameters and throw ArgumentNullException where previously a NullReferenceException could be thrown, if APIs were invoked with null input arguments.
Throwing ArgumentException 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 ArgumentNullException if invoked with null input arguments.

Reason for change

Throwing ArgumentNullException 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 passing null input arguments in the listed API.
  • If the code is handling NullReferenceException replace (or supplement) it with handling ArgumentNullException.

Category

  • Windows Forms

Version introduced: .NET 5.0 Preview 1

Affected APIs

Version introduced: .NET 5.0 Preview 2

Affected APIs

Version introduced: .NET 5.0 Preview 5

Affected APIs

Version introduced: .NET 5.0 Preview 6

Affected APIs

Version introduced: .NET 5.0 Preview 7

Affected APIs

Version introduced: .NET 5.0 Preview 8

Affected APIs

Version introduced: .NET 5.0 RC1

Affected APIs


Issue metadata

  • Issue type: breaking-change
@dotnet-bot dotnet-bot added ⌚ Not Triaged Not triaged breaking-change Indicates a .NET Core breaking change labels Feb 14, 2020
@gewarren gewarren added 🏁 Release: .NET 5 Work items for the .NET 5 release and removed ⌚ Not Triaged Not triaged labels Feb 14, 2020
@gewarren gewarren self-assigned this Feb 14, 2020
@RussKie

This comment has been minimized.

@gewarren
Copy link
Contributor

@RussKie Shoot! I think the checklist will be easier since you don't have to edit the markdown.

@RussKie

This comment has been minimized.

@RussKie

This comment has been minimized.

@gewarren
Copy link
Contributor

No, I'll reopen this one.

@RussKie
Copy link
Member Author

RussKie commented Oct 21, 2020

I'll have new ones opened for 6.0 😉
Thank you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Indicates a .NET Core breaking change 🏁 Release: .NET 5 Work items for the .NET 5 release winforms/subsvc
Projects
None yet
Development

No branches or pull requests

5 participants