Merge pull request #381 from jeroensmeets/dev
prevent crash when avatar not set on fresh install
This commit is contained in:
commit
df96b800c4
1 changed files with 1 additions and 1 deletions
|
@ -132,7 +132,7 @@ class Profile extends Model
|
|||
{
|
||||
$url = Cache::remember("avatar:{$this->id}", 1440, function() {
|
||||
$path = $this->avatar->media_path ?? 'public/avatars/default.png';
|
||||
$version = hash('sha1', $this->avatar->created_at);
|
||||
$version = $this->avatar ? hash('sha1', $this->avatar->created_at) : '';
|
||||
$path = "{$path}?v={$version}";
|
||||
return url(Storage::url($path));
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue