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 13e499d65..90805bfc4 100644
--- a/plugins/TwitterBridge/twitter.php
+++ b/plugins/TwitterBridge/twitter.php
@@ -273,7 +273,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 ' .