fix crash in ComposeActivity when account has no profile picture set
This commit is contained in:
parent
5dbe3c927e
commit
1a3907936d
1 changed files with 9 additions and 5 deletions
|
@ -456,11 +456,15 @@ public final class ComposeActivity extends BaseActivity
|
||||||
|
|
||||||
ImageView composeAvatar = findViewById(R.id.composeAvatar);
|
ImageView composeAvatar = findViewById(R.id.composeAvatar);
|
||||||
|
|
||||||
Picasso.with(this).load(activeAccount.getProfilePictureUrl())
|
if(TextUtils.isEmpty(activeAccount.getProfilePictureUrl())) {
|
||||||
.transform(new RoundedTransformation(7, 0))
|
composeAvatar.setImageResource(R.drawable.avatar_default);
|
||||||
.error(R.drawable.avatar_default)
|
} else {
|
||||||
.placeholder(R.drawable.avatar_default)
|
Picasso.with(this).load(activeAccount.getProfilePictureUrl())
|
||||||
.into(composeAvatar);
|
.transform(new RoundedTransformation(7, 0))
|
||||||
|
.error(R.drawable.avatar_default)
|
||||||
|
.placeholder(R.drawable.avatar_default)
|
||||||
|
.into(composeAvatar);
|
||||||
|
}
|
||||||
|
|
||||||
composeAvatar.setContentDescription(
|
composeAvatar.setContentDescription(
|
||||||
getString(R.string.compose_active_account_description,
|
getString(R.string.compose_active_account_description,
|
||||||
|
|
Loading…
Add table
Reference in a new issue