rspec/rules/S1696/description.adoc

2 lines
299 B
Plaintext
Raw Normal View History

2021-01-27 13:42:22 +01:00
``++NullPointerException++`` should be avoided, not caught. Any situation in which ``++NullPointerException++`` 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.