applySafe

fun <T> applySafe(obj: T?, block: Consumer<T>): T?

Calls the specified function block with obj value as its argument and returns obj.

If obj is null, the function is not called.