summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-09-12 17:11:55 -0400
committerCraig Andrews <candrews@integralblue.com>2009-09-12 17:11:55 -0400
commit29d937d04ef1d5bf83493a16e90dc4b9b7b5a059 (patch)
tree8ef64f08f79dfe90de207b80fb7821fe5085358f /actions
parent7cd80b29c45c2255e32328dc8b4e8a19933aa645 (diff)
Check if the avatar exists before trying to delete it.
Fixes http://status.net/trac/ticket/1868
Diffstat (limited to 'actions')
-rw-r--r--actions/avatarsettings.php8
1 files 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);
}