Merge pull request #228 from 1day2die/discord_avatar
Fixed error with discord pics not loading
This commit is contained in:
commit
e8a4f3d97f
|
@ -214,12 +214,17 @@ 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