Last published: September 24, 2026
KT.EQUALS_NULL_CALL
Method 'equals()' is called with null parameter
To compare an object with null prefer using ==. This rule detects and reports instances in the code where the equals() method is used to compare a value with null.
Noncompliant Code
Copy
fun isNull(str: String) = str.equals(null)
Compliant Code
Copy
fun isNull(str: String) = str == null