mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
prevent crash on async callback
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
03e0bd57bb
commit
005dfa9397
@ -277,21 +277,26 @@ class LocationPickerController(args: Bundle) :
|
||||
DelayedMapListener(
|
||||
object : MapListener {
|
||||
override fun onScroll(paramScrollEvent: ScrollEvent): Boolean {
|
||||
when {
|
||||
moveToCurrentLocationWasClicked -> {
|
||||
setLocationDescription(isGpsLocation = true, isGeocodedResult = false)
|
||||
moveToCurrentLocationWasClicked = false
|
||||
}
|
||||
receivedChosenGeocodingResult -> {
|
||||
binding.shareLocation.isClickable = true
|
||||
setLocationDescription(isGpsLocation = false, isGeocodedResult = true)
|
||||
receivedChosenGeocodingResult = false
|
||||
}
|
||||
else -> {
|
||||
binding.shareLocation.isClickable = true
|
||||
setLocationDescription(isGpsLocation = false, isGeocodedResult = false)
|
||||
try {
|
||||
when {
|
||||
moveToCurrentLocationWasClicked -> {
|
||||
setLocationDescription(isGpsLocation = true, isGeocodedResult = false)
|
||||
moveToCurrentLocationWasClicked = false
|
||||
}
|
||||
receivedChosenGeocodingResult -> {
|
||||
binding.shareLocation.isClickable = true
|
||||
setLocationDescription(isGpsLocation = false, isGeocodedResult = true)
|
||||
receivedChosenGeocodingResult = false
|
||||
}
|
||||
else -> {
|
||||
binding.shareLocation.isClickable = true
|
||||
setLocationDescription(isGpsLocation = false, isGeocodedResult = false)
|
||||
}
|
||||
}
|
||||
} catch (e: NullPointerException) {
|
||||
Log.d(TAG, "UI already closed")
|
||||
}
|
||||
|
||||
readyToShareLocation = true
|
||||
return true
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user