Fixed error with discord pics not loading
This commit is contained in:
parent
6325cd8f87
commit
4f838d89bb
|
@ -213,13 +213,18 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||||
*/
|
*/
|
||||||
public function getAvatar()
|
public function getAvatar()
|
||||||
{
|
{
|
||||||
if ($this->discordUser()->exists()) {
|
if ($this->discordUser()->exists()){
|
||||||
$avatar = $this->discordUser->getAvatar();
|
if(@getimagesize($this->discordUser->getAvatar())) {
|
||||||
|
$avatar = $this->discordUser->getAvatar();
|
||||||
|
} else {
|
||||||
|
$avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email)));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email)));
|
$avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $avatar;
|
return $avatar;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue