safely

fun <T, R> (T) -> R.safely(input: T): R?

Executes the receiver function safely, returning null if an exception occurs.

Return

The result of the function or null if an exception occurred.

Parameters

T

The input type for the function.

R

The output type of the function.

input

The input value for the function.