From 29d937d04ef1d5bf83493a16e90dc4b9b7b5a059 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Sat, 12 Sep 2009 17:11:55 -0400 Subject: Check if the avatar exists before trying to delete it. Fixes http://status.net/trac/ticket/1868 --- actions/avatarsettings.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/actions/avatarsettings.php b/actions/avatarsettings.php index 02a684b38..ded419dd7 100644 --- a/actions/avatarsettings.php +++ b/actions/avatarsettings.php @@ -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); } -- cgit v1.2.3-54-g00ecf