]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
continue deleting even if user profile record is missing
authorEvan Prodromou <evan@status.net>
Sun, 28 Mar 2010 15:58:16 +0000 (11:58 -0400)
committerEvan Prodromou <evan@status.net>
Sun, 28 Mar 2010 15:58:16 +0000 (11:58 -0400)
classes/User.php

index 8ad2ec63d5c81d12cbf6c3b35c7eb41b8cac5e60..659ec9467b68b7a7cf880db07696d3e00e28acc4 100644 (file)
@@ -670,8 +670,12 @@ class User extends Memcached_DataObject
 
     function delete()
     {
-        $profile = $this->getProfile();
-        $profile->delete();
+        try {
+            $profile = $this->getProfile();
+            $profile->delete();
+        } catch (UserNoProfileException $unp) {
+            common_log(LOG_INFO, "User {$this->nickname} has no profile; continuing deletion.");
+        }
 
         $related = array('Fave',
                          'Confirm_address',
@@ -679,6 +683,7 @@ class User extends Memcached_DataObject
                          'Foreign_link',
                          'Invitation',
                          );
+
         Event::handle('UserDeleteRelated', array($this, &$related));
 
         foreach ($related as $cls) {