mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-10 08:00:57 +00:00
Merge pull request #1425 from nextcloud/bugfix/1424/conversationInfoViewBindingNPE
Binding can be null due to async call
This commit is contained in:
commit
1333ce768a
@ -427,8 +427,15 @@ class ConversationInfoController(args: Bundle) :
|
|||||||
participantsDisposable = d
|
participantsDisposable = d
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||||
override fun onNext(participantsOverall: ParticipantsOverall) {
|
override fun onNext(participantsOverall: ParticipantsOverall) {
|
||||||
|
try {
|
||||||
handleParticipants(participantsOverall.ocs.data)
|
handleParticipants(participantsOverall.ocs.data)
|
||||||
|
} catch (npe: NullPointerException) {
|
||||||
|
// view binding can be null
|
||||||
|
// since this is called asynchronously and UI might have been destroyed in the meantime
|
||||||
|
Log.i(TAG, "UI destroyed - view binding already gone")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(e: Throwable) {
|
override fun onError(e: Throwable) {
|
||||||
@ -513,7 +520,9 @@ class ConversationInfoController(args: Bundle) :
|
|||||||
roomDisposable = d
|
roomDisposable = d
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||||
override fun onNext(roomOverall: RoomOverall) {
|
override fun onNext(roomOverall: RoomOverall) {
|
||||||
|
try {
|
||||||
conversation = roomOverall.ocs.data
|
conversation = roomOverall.ocs.data
|
||||||
|
|
||||||
val conversationCopy = conversation
|
val conversationCopy = conversation
|
||||||
@ -563,6 +572,11 @@ class ConversationInfoController(args: Bundle) :
|
|||||||
|
|
||||||
binding.notificationSettingsView.notificationSettings.visibility = View.VISIBLE
|
binding.notificationSettingsView.notificationSettings.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
|
} catch (npe: NullPointerException) {
|
||||||
|
// view binding can be null
|
||||||
|
// since this is called asynchronously and UI might have been destroyed in the meantime
|
||||||
|
Log.i(TAG, "UI destroyed - view binding already gone")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(e: Throwable) {
|
override fun onError(e: Throwable) {
|
||||||
@ -986,7 +1000,7 @@ class ConversationInfoController(args: Bundle) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val TAG = "ConversationInfoController"
|
private const val TAG = "ConversationInfControll"
|
||||||
private const val ID_DELETE_CONVERSATION_DIALOG = 0
|
private const val ID_DELETE_CONVERSATION_DIALOG = 0
|
||||||
private val LOW_EMPHASIS_OPACITY: Float = 0.38f
|
private val LOW_EMPHASIS_OPACITY: Float = 0.38f
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user