mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-23 16:24:29 +00:00
prevent crash when avatar not set on fresh install
This commit is contained in:
parent
9fba7017fc
commit
bdc8ec77f0
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() {
|
$url = Cache::remember("avatar:{$this->id}", 1440, function() {
|
||||||
$path = $this->avatar->media_path ?? 'public/avatars/default.png';
|
$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}";
|
$path = "{$path}?v={$version}";
|
||||||
return url(Storage::url($path));
|
return url(Storage::url($path));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue