mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +01:00
Catch NPE on Profile view binding
Resolves: #1959 Signed-off-by: Tim Krüger <t@timkrueger.me>
This commit is contained in:
parent
ff5f686d7c
commit
5cb36d0801
@ -93,7 +93,6 @@ import retrofit2.Response
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
import java.io.IOException
|
||||
import java.util.ArrayList
|
||||
import java.util.LinkedList
|
||||
import java.util.Locale
|
||||
import javax.inject.Inject
|
||||
@ -341,13 +340,20 @@ class ProfileController : NewBaseController(R.layout.controller_profile) {
|
||||
if (activity == null) {
|
||||
return
|
||||
}
|
||||
binding.emptyList.emptyListViewHeadline.text = headline
|
||||
binding.emptyList.emptyListViewText.text = message
|
||||
binding.emptyList.emptyListIcon.setImageResource(errorResource)
|
||||
binding.emptyList.emptyListIcon.visibility = View.VISIBLE
|
||||
binding.emptyList.emptyListViewText.visibility = View.VISIBLE
|
||||
binding.userinfoList.visibility = View.GONE
|
||||
binding.loadingContent.visibility = View.GONE
|
||||
|
||||
try {
|
||||
binding.emptyList.emptyListViewHeadline.text = headline
|
||||
binding.emptyList.emptyListViewText.text = message
|
||||
binding.emptyList.emptyListIcon.setImageResource(errorResource)
|
||||
binding.emptyList.emptyListIcon.visibility = View.VISIBLE
|
||||
binding.emptyList.emptyListViewText.visibility = View.VISIBLE
|
||||
binding.userinfoList.visibility = View.GONE
|
||||
binding.loadingContent.visibility = View.GONE
|
||||
} 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")
|
||||
}
|
||||
}
|
||||
|
||||
private fun createUserInfoDetails(userInfo: UserProfileData?): List<UserInfoDetailsItem> {
|
||||
|
Loading…
Reference in New Issue
Block a user