]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/avatarsettings.php
Bug 1969: rebuild corrupted l10n files which caused all UI strings to be shown as...
[quix0rs-gnu-social.git] / actions / avatarsettings.php
index 0bc439ff122a944f653ca8bd7978e38ec77d691a..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);
     }
@@ -399,5 +399,7 @@ class AvatarsettingsAction extends AccountSettingsAction
             $this->script('js/jcrop/jquery.Jcrop.min.js');
             $this->script('js/jcrop/jquery.Jcrop.go.js');
         }
+
+        $this->autofocus('avatarfile');
     }
 }