Check if the avatar exists before trying to delete it.

Fixes http://status.net/trac/ticket/1868
This commit is contained in:
Craig Andrews 2009-09-12 17:11:55 -04:00
parent 7cd80b29c4
commit 29d937d04e

View File

@ -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);
}