Merge pull request #16 from joseavilasg09/issue/profile-pic-empty

Fix issue with empty profile pic
This commit is contained in:
divyam234 2023-08-27 12:12:10 +05:30 committed by GitHub
commit e5906b711f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,6 +70,9 @@ func (us *UserService) GetProfilePhoto(c *gin.Context) {
return err
}
peer := self.AsInputPeer()
if self.Photo == nil {
return nil
}
photo, _ := self.Photo.AsNotEmpty()
location := &tg.InputPeerPhotoFileLocation{Big: false, Peer: peer, PhotoID: photo.PhotoID}
buff, err := iterContent(c, client, location)