Inspectopedia Help

Null-checks can be replaced with safe-calls

Reports chained null-checks that can be replaced with safe-calls.

Example:

fun test(my: My?) { if (my != null && my.foo() != null) {} }

After the quick-fix is applied:

fun test(my: My?) { if (my?.foo() != null) {} }

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Kotlin, @snapshot@

Last modified: 13 July 2023