diff options
Diffstat (limited to 'app/Helper/UserHelper.php')
-rw-r--r-- | app/Helper/UserHelper.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/Helper/UserHelper.php b/app/Helper/UserHelper.php index 90f84033..c60c35c2 100644 --- a/app/Helper/UserHelper.php +++ b/app/Helper/UserHelper.php @@ -171,7 +171,12 @@ class UserHelper extends Base */ public function avatar($user_id, $username, $name, $email) { - $html = $this->avatarManager->render($user_id, $username, $name, $email, 48); + if (empty($user_id) && empty($username)) { + $html = $this->avatarManager->renderDefault(48); + } else { + $html = $this->avatarManager->render($user_id, $username, $name, $email, 48); + } + return '<div class="avatar">'.$html.'</div>'; } } |