From 4d4243482433e8ab88c286bd82d90fa367dbe56d Mon Sep 17 00:00:00 2001 From: Li Linfeng Date: Tue, 31 Mar 2020 12:12:22 +0800 Subject: [PATCH] Fix crash in touch location get first object --- app/src/main/java/space/celestia/mobilecelestia/CelestiaView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/space/celestia/mobilecelestia/CelestiaView.kt b/app/src/main/java/space/celestia/mobilecelestia/CelestiaView.kt index 4af1d0f3..1350ba3c 100644 --- a/app/src/main/java/space/celestia/mobilecelestia/CelestiaView.kt +++ b/app/src/main/java/space/celestia/mobilecelestia/CelestiaView.kt @@ -110,7 +110,7 @@ class CelestiaView(context: Context) : GLSurfaceView(context), Choreographer.Fra touchActive = false } else if (touchLocations.size == 1) { // Canceled convert to one finger tap - val loc = touchLocations[0]!! + val loc = touchLocations.map { it.value }[0] Log.d(TAG, "One finger tap action") val point = loc.point queueEvent {