ifNull

infix inline fun Any?.ifNull(block: Block)

evaluates a block if the receiver object is null.

Parameters

<receiver>

Any?

block

block of code to execute if null

inline fun Any?.ifNull(block: Block, otherwise: Block)

evaluates first block if receiver object is null, otherwise evaluates the second block.

Parameters

<receiver>

Any?

block

block of code to execute if null

otherwise

alternative block of code to execute if not null