Check if the avatar exists before trying to delete it.
Fixes http://status.net/trac/ticket/1868
This commit is contained in:
		| @@ -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); | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user