Inspectopedia
 
2024.3

Unnecessary 'null' check before method call

Warning
New
Last modified: 03 December 2024

Reports null checks followed by a method call that will definitely return false when null is passed (e.g. Class.isInstance).

Such a check seems excessive as the method call will always return false in this case.

Example:

After the quick-fix is applied: