Check for Twitter foreign link actually existing before trying to delete it; friendlier error message in TwittersettingsAction
This commit is contained in:
parent
7adc6027ff
commit
5fe59322bc
@ -247,6 +247,11 @@ class TwittersettingsAction extends ConnectSettingsAction
|
|||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
$flink = Foreign_link::getByUserID($user->id, TWITTER_SERVICE);
|
$flink = Foreign_link::getByUserID($user->id, TWITTER_SERVICE);
|
||||||
|
|
||||||
|
if (empty($flink)) {
|
||||||
|
$this->clientError(_m('No Twitter connection to remove.'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$result = $flink->safeDelete();
|
$result = $flink->safeDelete();
|
||||||
|
|
||||||
if (empty($result)) {
|
if (empty($result)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user