ifNull

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

Calls the body function if T was null.

Return

The result from body as U.

Parameters

body

The body function to call if T was null.