From: Alexander Ebert Date: Sat, 26 Aug 2023 18:15:11 +0000 (+0200) Subject: Fix the handling of a missing custom avatar X-Git-Tag: 6.0.0_Beta_4~49 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=806bfe5d26b93f333bc51ed0cc39622d7df150b1;p=GitHub%2FWoltLab%2FWCF.git Fix the handling of a missing custom avatar See https://www.woltlab.com/community/thread/301317-error-trying-to-upload-an-avatar-by-acp/ --- diff --git a/wcfsetup/install/files/acp/templates/userAdd.tpl b/wcfsetup/install/files/acp/templates/userAdd.tpl index f05c8019b6..003891db32 100644 --- a/wcfsetup/install/files/acp/templates/userAdd.tpl +++ b/wcfsetup/install/files/acp/templates/userAdd.tpl @@ -628,7 +628,7 @@
- {if $avatarType == 'custom'} + {if $avatarType == 'custom' && $userAvatar !== null} {@$userAvatar->getImageTag(96)} {else} diff --git a/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php b/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php index 0efc1c96d9..c4aeeae832 100755 --- a/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php @@ -282,7 +282,7 @@ class UserEditForm extends UserAddForm parent::readData(); // get the avatar object - if ($this->avatarType == 'custom') { + if ($this->avatarType == 'custom' && $this->user->avatarID) { $this->userAvatar = new UserAvatar($this->user->avatarID); }