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

Rule S1696: 'NullReferenceException' should not be caught #583

Closed
Evangelink opened this issue Jul 21, 2017 · 0 comments
Closed

Rule S1696: 'NullReferenceException' should not be caught #583

Evangelink opened this issue Jul 21, 2017 · 0 comments
Assignees
Milestone

Comments

@Evangelink
Copy link
Contributor

Evangelink commented Jul 21, 2017

RSPEC-1696

NullReferenceException should be avoided, not caught. Any situation in which NullReferenceException is explicitly caught can easily be converted to a null test, and any behavior being carried out in the catch block can easily be moved to the "is null" branch of the conditional.

@Evangelink Evangelink added this to the near-future milestone Jul 21, 2017
@Evangelink Evangelink modified the milestones: 6.4, near-future, 6.3 Jul 25, 2017
@Evangelink Evangelink changed the title Rule S1696: "NullPointerException" should not be caught Rule S1696: 'NullReferenceException' should not be caught Jul 25, 2017
@Evangelink Evangelink self-assigned this Jul 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants