]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Check if the avatar exists before trying to delete it.
authorCraig Andrews <candrews@integralblue.com>
Sat, 12 Sep 2009 21:11:55 +0000 (17:11 -0400)
committerCraig Andrews <candrews@integralblue.com>
Sat, 12 Sep 2009 21:11:55 +0000 (17:11 -0400)
Fixes http://status.net/trac/ticket/1868

actions/avatarsettings.php

index 02a684b38f2649c5e8d45a3d096114e631a8bf6d..ded419dd797a7c88d012a2b9b4a6ca6d0d4a9e25 100644 (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);
     }