From 7c8105c338e4c1f9a3111c2e22b5974cd13e0736 Mon Sep 17 00:00:00 2001 From: Mazarin Date: Wed, 13 Jul 2022 19:23:44 -0400 Subject: [PATCH] fix: fix avatar not being loaded on dashboard (#6224) --- app/Models/Contact/Contact.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Models/Contact/Contact.php b/app/Models/Contact/Contact.php index e8f94d8c43b..c1de8abdd87 100644 --- a/app/Models/Contact/Contact.php +++ b/app/Models/Contact/Contact.php @@ -1152,7 +1152,11 @@ public function getAvatarURL() $avatarURL = $this->avatar_gravatar_url; break; case 'photo': - $avatarURL = $this->avatarPhoto()->first()->url(); + if ($this->avatarPhoto) { + $avatarURL = $this->avatarPhoto()->first()->url(); + } else { + $avatarURL = $this->getAvatarDefaultURL(); + } break; case 'default': default: