safeCast

inline fun <T : Any> Any?.safeCast(): T?

See also