summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--classes/User.php5
-rw-r--r--lib/deluserqueuehandler.php10
2 files changed, 11 insertions, 4 deletions
diff --git a/classes/User.php b/classes/User.php
index 2c256301c..1928a3c62 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -548,7 +548,10 @@ class User extends Memcached_DataObject
return false;
}
- Subscription::cancel($other, $this->getProfile());
+ $self = $this->getProfile();
+ if (Subscription::exists($other, $self)) {
+ Subscription::cancel($other, $self);
+ }
$block->query('COMMIT');
diff --git a/lib/deluserqueuehandler.php b/lib/deluserqueuehandler.php
index 4a1233a5e..710303938 100644
--- a/lib/deluserqueuehandler.php
+++ b/lib/deluserqueuehandler.php
@@ -49,9 +49,13 @@ class DelUserQueueHandler extends QueueHandler
return true;
}
- if (!$user->hasRole(Profile_role::DELETED)) {
- common_log(LOG_INFO, "User {$user->nickname} is not pending deletion; aborting.");
- return true;
+ try {
+ if (!$user->hasRole(Profile_role::DELETED)) {
+ common_log(LOG_INFO, "User {$user->nickname} is not pending deletion; aborting.");
+ return true;
+ }
+ } catch (UserNoProfileException $unp) {
+ common_log(LOG_INFO, "Deleting user {$user->nickname} with no profile... probably a good idea!");
}
$notice = $this->getNextBatch($user);