Exception handling regarding Foreign_link

This commit is contained in:
Mikael Nordfeldth
2015-07-18 11:39:34 +02:00
parent b609a3610f
commit e0084a6fdf
12 changed files with 88 additions and 102 deletions

View File

@@ -66,13 +66,12 @@ class Facebookclient
$this->notice = $notice;
$profile_id = $profile ? $profile->id : $notice->profile_id;
$this->flink = Foreign_link::getByUserID(
$profile_id,
FACEBOOK_SERVICE
);
if (!empty($this->flink)) {
try {
$this->flink = Foreign_link::getByUserID($profile_id, FACEBOOK_SERVICE);
$this->user = $this->flink->getUser();
} catch (NoResultException $e) {
// at least $this->flink could've gotten set to something,
// but the logic that was here before didn't care, so let's not care either
}
}