getOrNull

Common
JVM
JS
Native
1.0
fun getOrNull(): T?

Returns the encapsulated value if this instance represents success or null if it is failure.

This function is shorthand for getOrElse { null } (see getOrElse) or fold(onSuccess = { it }, onFailure = { null }) (see fold).