ifNull
ifNull execute when value is null.
Example:
val value: String? = null
value.ifNull { ... } // Unit
value.ifNull {
...
"i am not null"
} // i am not null
val value2 = "hello"
value2.ifNull { ... } // hello
value2.ifNull {
...
"i am not null"
} // hello
Content copied to clipboard
Since
1.1.0
Return
value or Unit