Fix crash in ViewImageFragment, fix #1876 (#1877)

It was not checked whether captionSheet is present.
main
Ivan Kupalov 4 years ago committed by Alibek Omarov
parent a4708a5ddb
commit 481140b73a
  1. 4
      app/src/main/java/com/keylesspalace/tusky/fragment/ViewImageFragment.kt

@ -172,7 +172,7 @@ class ViewImageFragment : ViewMediaFragment() {
}
override fun onToolbarVisibilityChange(visible: Boolean) {
if (photoView == null || !userVisibleHint) {
if (photoView == null || !userVisibleHint || captionSheet == null) {
return
}
isDescriptionVisible = showingDescription && visible
@ -180,7 +180,7 @@ class ViewImageFragment : ViewMediaFragment() {
captionSheet.animate().alpha(alpha)
.setListener(object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator) {
captionSheet.visible(isDescriptionVisible)
captionSheet?.visible(isDescriptionVisible)
animation.removeListener(this)
}
})

Loading…
Cancel
Save