From 25348da8f8c09373b1ebaf73192b6d8d9fd450a7 Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Mon, 3 Apr 2023 21:48:08 +0200 Subject: [PATCH] :bug: fix error on avatar profile --- app/Traits/HasProfilePhoto.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Traits/HasProfilePhoto.php b/app/Traits/HasProfilePhoto.php index 9abe276b..9ca91fa2 100644 --- a/app/Traits/HasProfilePhoto.php +++ b/app/Traits/HasProfilePhoto.php @@ -18,7 +18,7 @@ public function getProfilePhotoUrlAttribute(): ?string /** @var SocialAccount $social_avatar */ $social_avatar = $this->providers->firstWhere('provider', $this->avatar_type); - return $social_avatar->avatar; + return $social_avatar ? $social_avatar->avatar : $this->defaultProfilePhotoUrl(); } return $this->defaultProfilePhotoUrl();