1
0
mirror of https://github.com/nextcloud/talk-android synced 2025-07-07 12:59:55 +01:00

prevent crash on async callback

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2021-06-11 15:29:26 +02:00
parent 03e0bd57bb
commit 005dfa9397
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B

View File

@ -277,21 +277,26 @@ class LocationPickerController(args: Bundle) :
DelayedMapListener( DelayedMapListener(
object : MapListener { object : MapListener {
override fun onScroll(paramScrollEvent: ScrollEvent): Boolean { override fun onScroll(paramScrollEvent: ScrollEvent): Boolean {
when { try {
moveToCurrentLocationWasClicked -> { when {
setLocationDescription(isGpsLocation = true, isGeocodedResult = false) moveToCurrentLocationWasClicked -> {
moveToCurrentLocationWasClicked = false setLocationDescription(isGpsLocation = true, isGeocodedResult = false)
} moveToCurrentLocationWasClicked = false
receivedChosenGeocodingResult -> { }
binding.shareLocation.isClickable = true receivedChosenGeocodingResult -> {
setLocationDescription(isGpsLocation = false, isGeocodedResult = true) binding.shareLocation.isClickable = true
receivedChosenGeocodingResult = false setLocationDescription(isGpsLocation = false, isGeocodedResult = true)
} receivedChosenGeocodingResult = false
else -> { }
binding.shareLocation.isClickable = true else -> {
setLocationDescription(isGpsLocation = false, isGeocodedResult = false) binding.shareLocation.isClickable = true
setLocationDescription(isGpsLocation = false, isGeocodedResult = false)
}
} }
} catch (e: NullPointerException) {
Log.d(TAG, "UI already closed")
} }
readyToShareLocation = true readyToShareLocation = true
return true return true
} }