Refactoring: make "if-then to safe access" an inspection
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
|
||||
// FIX: Remove redundant 'if' expression
|
||||
|
||||
interface Bar
|
||||
|
||||
data class Data(val bar: Bar?)
|
||||
|
||||
fun handle(data: Data) {
|
||||
val bar = <caret>if (data.bar != null) data.bar else null
|
||||
}
|
||||
Reference in New Issue
Block a user