ifNotNull

fun <T, U> T?.ifNotNull(body: T.() -> U): U?

Calls the body function if T was not null.

Return

The result from the body as U.

Parameters

body

The body function to call if T was not null.