Skip to content

Commit

Permalink
[fix] load default picture link if not present (#1709)
Browse files Browse the repository at this point in the history
  • Loading branch information
jywadhwani authored Jun 25, 2020
1 parent 776d6b3 commit 60b7c63
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@ public static UserEntity toUserEntityView(CorpUser corpUser) {
UserEntity user = new UserEntity();
user.setCategory("person");
user.setLabel(corpUser.getUsername());
user.setDisplayName(corpUser.getInfo().getDisplayName());
user.setPictureLink(corpUser.getEditableInfo().getPictureLink().toString());
if (corpUser.hasInfo()) {
user.setDisplayName(corpUser.getInfo().getDisplayName());
}
if (corpUser.hasEditableInfo() && corpUser.getEditableInfo().hasPictureLink()) {
user.setPictureLink(corpUser.getEditableInfo().getPictureLink().toString());
}
return user;
}
}

0 comments on commit 60b7c63

Please sign in to comment.