getOrNull

fun getOrNull(): T?

Returns the success value if this is a Success, or null if this is a Failure.

This method provides safe access to the result data without throwing exceptions.

val data: ByteArray? = result.getOrNull()
data?.let { processData(it) }

Return

The success value, or null if this is a failure.