kotlin.collections.elementAtOrNull

elementAtOrNull

fun <T> Iterable<T>.elementAtOrNull(index: Int): T?

Returns an element at the given index or null if the index is out of bounds of this collection.