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
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.
The text was updated successfully, but these errors were encountered:
Evangelink
changed the title
Rule S1696: "NullPointerException" should not be caught
Rule S1696: 'NullReferenceException' should not be caught
Jul 25, 2017
RSPEC-1696
NullReferenceException
should be avoided, not caught. Any situation in whichNullReferenceException
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.The text was updated successfully, but these errors were encountered: