Skip to content

Commit

Permalink
Merge pull request #693 from SusanaFernandes/fenixAPI/FIST-816
Browse files Browse the repository at this point in the history
Avoid NPE when user has no photo FIST-816 #resolve
  • Loading branch information
ricardorcr authored Oct 17, 2019
2 parents 3387366 + 1c1ef39 commit 95751d7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ private String mls(LocalizedString mls) {

private FenixPhoto getPhoto(final Person person) {
final String type = ContentType.PNG.getMimeType();
final byte[] avatar = person != null && person.isPhotoAvailableToCurrentUser() ?
person.getPersonalPhoto().getDefaultAvatar() : mysteryman();
final byte[] avatar = person != null && person.getPersonalPhoto() != null
&& person.isPhotoAvailableToCurrentUser() ? person.getPersonalPhoto().getDefaultAvatar() : mysteryman();
final String data = Base64.getEncoder().encodeToString(avatar);
return new FenixPhoto(type, data);
}
Expand Down

0 comments on commit 95751d7

Please sign in to comment.