]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix fatal error in FacebookremoveAction if we end up getting called double and the...
authorBrion Vibber <brion@pobox.com>
Fri, 8 Oct 2010 18:06:30 +0000 (11:06 -0700)
committerBrion Vibber <brion@pobox.com>
Fri, 8 Oct 2010 18:06:30 +0000 (11:06 -0700)
plugins/Facebook/facebookremove.php

index b048a435f5744bf98e344920ff9553193cb737f6..bc76daaef6f91d9d02a086fbb459f36e51161421 100644 (file)
@@ -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();