Fixed error with discord pics not loading

This commit is contained in:
Dennis 2021-10-13 19:24:40 +02:00 committed by GitHub
parent 6325cd8f87
commit 4f838d89bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -213,13 +213,18 @@ class User extends Authenticatable implements MustVerifyEmail
*/
public function getAvatar()
{
if ($this->discordUser()->exists()) {
$avatar = $this->discordUser->getAvatar();
if ($this->discordUser()->exists()){
if(@getimagesize($this->discordUser->getAvatar())) {
$avatar = $this->discordUser->getAvatar();
} else {
$avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email)));
}
} else {
$avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email)));
}
return $avatar;
}
/**