We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33d4844 commit 380f0f2Copy full SHA for 380f0f2
app/User.php
@@ -160,8 +160,16 @@ public function hasSocialAccount($socialDriver = false)
160
*/
161
public function getAvatar($size = 50)
162
{
163
- if ($this->image_id === 0 || $this->image_id === '0' || $this->image_id === null) return baseUrl('/user_avatar.png');
164
- return baseUrl($this->avatar->getThumb($size, $size, false));
+ $default = baseUrl('/user_avatar.png');
+ $imageId = $this->image_id;
165
+ if ($imageId === 0 || $imageId === '0' || $imageId === null) return $default;
166
+
167
+ try {
168
+ $avatar = baseUrl($this->avatar->getThumb($size, $size, false));
169
+ } catch (\Exception $err) {
170
+ $avatar = $default;
171
+ }
172
+ return $avatar;
173
}
174
175
/**
0 commit comments