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();