exists

@JvmName(name = "withIfExists")
inline fun <T, R> exists(receiver: T?, block: T & Any.() -> R): R?

Syntax-sugar equivalent to a with block that only executes if the receiver is not null.


@JvmName(name = "letIfExists")
infix inline fun <T, R> T?.exists(block: T & Any.() -> R): R?

Syntax-sugar equivalent to a run block that only executes if the receiver is not null.