Hello I'm having an error when passing the same value from if to else the logcat doesn't give me more information just E / AndroidRuntime: FATAL EXCEPTION: main, and points the line that contains the if and the else. could someone tell me how to fix it? any help is welcome.
override fun onMapReady(googleMap: GoogleMap) {
Log.i("MAP READY", "READY")
LINE ERROR val position = if (currentLocation != null) LatLng(currentLocation!!.latitude, currentLocation!!.longitude) else LatLng(currentLocation!!.latitude, currentLocation!!.longitude)
this.map = googleMap
this.map!!.moveCamera(CameraUpdateFactory.newLatLngZoom(position, 15f)) // Vienna
getFineLocationPermission()
this.map!!.setOnMarkerClickListener(this)
this.map!!.uiSettings.isRotateGesturesEnabled = true
this.map!!.uiSettings.isZoomGesturesEnabled = true
this.map!!.setOnInfoWindowClickListener(this)
this.map!!.setOnMapLongClickListener(this)
}