Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36d62fde authored by Christophe Henry's avatar Christophe Henry Committed by Marvin W.
Browse files

Prevent an ArrayIndexOutOfBoundsException when calling extension function...

Prevent an ArrayIndexOutOfBoundsException when calling extension function LongSparseArray.values() in GoogleMap
parent 3e733135
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ import org.microg.gms.maps.mapbox.utils.MultiArchLoader
import org.microg.gms.maps.mapbox.utils.toGms
import org.microg.gms.maps.mapbox.utils.toMapbox

private fun <T : Any> LongSparseArray<T>.values() = (0..size()).map { valueAt(it) }.mapNotNull { it }
private fun <T : Any> LongSparseArray<T>.values() = (0 until size()).mapNotNull { valueAt(it) }

fun runOnMainLooper(method: () -> Unit) {
    if (Looper.myLooper() == Looper.getMainLooper()) {