kotlin.collections.getOrNull

getOrNull

fun <T> List<T>.getOrNull(index: Int): T?

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