Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,16 @@ class EditProfileFragment : Fragment() {
val imageUrl = it.avatarUrl.nullToEmpty()
rootView.firstName.setText(userFirstName)
rootView.lastName.setText(userLastName)
context?.let { ctx ->
val drawable = AppCompatResources.getDrawable(ctx, R.drawable.ic_account_circle_grey_24dp)
drawable?.let { icon ->
Picasso.get()
.load(imageUrl)
.placeholder(icon)
.transform(CircleTransform())
.into(rootView.profilePhoto)
if (!imageUrl.isEmpty()) { // picasso requires the imageUrl to be non empty
context?.let { ctx ->
val drawable = AppCompatResources.getDrawable(ctx, R.drawable.ic_account_circle_grey_24dp)
drawable?.let { icon ->
Picasso.get()
.load(imageUrl)
.placeholder(icon)
.transform(CircleTransform())
.into(rootView.profilePhoto)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix indentation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}
}
Expand Down