From 56103f99e014cf9e9462fcdbbe3fed3504e6df26 Mon Sep 17 00:00:00 2001 From: Ali Shariat Date: Wed, 15 Dec 2021 20:45:41 +0330 Subject: [PATCH] fix: force close in the camera demo activity (#796) map object was not initialized, and it caused a crash in the sample app --- .../src/gms/java/com/example/kotlindemos/CameraDemoActivity.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/CameraDemoActivity.kt b/ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/CameraDemoActivity.kt index b81e053a..1e21c1ed 100644 --- a/ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/CameraDemoActivity.kt +++ b/ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/CameraDemoActivity.kt @@ -104,6 +104,7 @@ class CameraDemoActivity : // [END_EXCLUDE] override fun onMapReady(googleMap: GoogleMap) { + map = googleMap // return early if the map was not initialised properly with(googleMap) { setOnCameraIdleListener(this@CameraDemoActivity)