firstNotNull

fun <T> List<T?>.firstNotNull(): T

Returns the first element which is not null.

Throws

if there are no elements or all elements are null.