forked from GNUsocial/gnu-social
Check if the avatar exists before trying to delete it.
Fixes http://status.net/trac/ticket/1868
This commit is contained in:
parent
7cd80b29c4
commit
29d937d04e
@ -362,13 +362,13 @@ class AvatarsettingsAction extends AccountSettingsAction
|
||||
$profile = $user->getProfile();
|
||||
|
||||
$avatar = $profile->getOriginalAvatar();
|
||||
$avatar->delete();
|
||||
if($avatar) $avatar->delete();
|
||||
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
|
||||
$avatar->delete();
|
||||
if($avatar) $avatar->delete();
|
||||
$avatar = $profile->getAvatar(AVATAR_STREAM_SIZE);
|
||||
$avatar->delete();
|
||||
if($avatar) $avatar->delete();
|
||||
$avatar = $profile->getAvatar(AVATAR_MINI_SIZE);
|
||||
$avatar->delete();
|
||||
if($avatar) $avatar->delete();
|
||||
|
||||
$this->showForm(_('Avatar deleted.'), true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user