getOrNull

fun <VALUE> Result<VALUE>.getOrNull(): VALUE?

Returns the encapsulated value if this instance represents Success or null for encapsulated exception if it is Error.

If Error.error is CancellationException then this error is rethrown.