summaryrefslogtreecommitdiff
path: root/plugins/TwitterBridge/twitter.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TwitterBridge/twitter.php')
-rw-r--r--plugins/TwitterBridge/twitter.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/TwitterBridge/twitter.php b/plugins/TwitterBridge/twitter.php
index ceb83b037..42db3c673 100644
--- a/plugins/TwitterBridge/twitter.php
+++ b/plugins/TwitterBridge/twitter.php
@@ -264,7 +264,16 @@ function remove_twitter_link($flink)
common_log(LOG_INFO, 'Removing Twitter bridge Foreign link for ' .
"user $user->nickname (user id: $user->id).");
- $result = $flink->delete();
+ $result = false;
+
+ // Be extra careful to make sure we have a good flink
+ // before deleting
+ if (!empty($flink->user_id)
+ && !empty($flink->foreign_id)
+ && !empty($flink->service))
+ {
+ $result = $flink->delete();
+ }
if (empty($result)) {
common_log(LOG_ERR, 'Could not remove Twitter bridge ' .