Reports combination of null and emptiness checks that can be simplified into a single check.
The quick-fix replaces highlighted checks with a combined check call, such as isNullOrEmpty().
Example:
fun test(list: List<Int>?) {
if (list == null || list.isEmpty()) {
println("List is empty!")
} else {
println(list.joinToString())
}
}
After the quick-fix is applied:
fun test(list: List<Int>?) {
if (list.isNullOrEmpty()) {
println("List is empty!")
} else {
println(list.joinToString())
}
}