From: Craig Andrews Date: Sat, 12 Sep 2009 21:11:55 +0000 (-0400) Subject: Check if the avatar exists before trying to delete it. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=29d937d04ef1d5bf83493a16e90dc4b9b7b5a059;p=quix0rs-gnu-social.git Check if the avatar exists before trying to delete it. Fixes http://status.net/trac/ticket/1868 --- diff --git a/actions/avatarsettings.php b/actions/avatarsettings.php index 02a684b38f..ded419dd79 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); }