Fixed crash when post doesn't contain media_attachments (#113)

This commit is contained in:
Andrew Dobis 2020-04-23 21:11:30 +02:00 committed by GitHub
parent 94635f5b72
commit 5decd6ae12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -179,7 +179,6 @@ data class Status(
nshares.setTypeface(null, Typeface.BOLD)
//Setup images
setupPostPics(rootView, request, homeFragment)
ImageConverter.setRoundImageFromURL(
rootView,
this.getProfilePicUrl(),
@ -187,6 +186,12 @@ data class Status(
)
rootView.profilePic.setOnClickListener { account.openProfile(rootView.context) }
//Setup post pic only if there are media attachments
if(!media_attachments.isNullOrEmpty()) {
setupPostPics(rootView, request, homeFragment)
}
//Set comment initial visibility
rootView.findViewById<LinearLayout>(R.id.commentIn).visibility = View.GONE
}