summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-10-08 11:06:30 -0700
committerBrion Vibber <brion@pobox.com>2010-10-08 11:06:30 -0700
commit7adc6027ff3c344f549bddd2c60372a2c5ea9c40 (patch)
treef440112139ec9634fd96db000853a640a3403342
parente23ad7392fa0a84a3cea2f50b0f96e4ba68a372b (diff)
Fix fatal error in FacebookremoveAction if we end up getting called double and the foreign_link entry has already been removed.
-rw-r--r--plugins/Facebook/facebookremove.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/Facebook/facebookremove.php b/plugins/Facebook/facebookremove.php
index b048a435f..bc76daaef 100644
--- a/plugins/Facebook/facebookremove.php
+++ b/plugins/Facebook/facebookremove.php
@@ -48,6 +48,12 @@ class FacebookremoveAction extends FacebookAction
$flink = Foreign_link::getByForeignID($this->arg('fb_sig_user'), 2);
+ if (!$flink) {
+ common_log(LOG_ERR, "Tried to delete missing foreign_link entry with Facebook ID " . $this->arg('fb_sig_user'));
+ $this->serverError(_m('Couldn\'t remove Facebook user: already deleted.'));
+ return;
+ }
+
common_debug("Removing foreign link to Facebook - local user ID: $flink->user_id, Facebook ID: $flink->foreign_id");
$result = $flink->delete();