whenNull

inline fun <T> T.whenNull(block: () -> Unit): T(source)

Calls the specified function block only when this value is null and then returns this value.