mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
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() {
|
$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