function __construct($notice)
{
$this->facebook = self::getFacebook();
- $this->notice = $notice;
+
+ if (empty($this->facebook)) {
+ throw new FacebookApiException(
+ "Could not create Facebook client! Bad application ID or secret?"
+ );
+ }
+
+ $this->notice = $notice;
$this->flink = Foreign_link::getByUserID(
$notice->profile_id,
$secret = common_config('facebook', 'global_secret');
}
+ if (empty($appId)) {
+ common_log(
+ LOG_WARNING,
+ "Couldn't find Facebook application ID!",
+ __FILE__
+ );
+ }
+
+ if (empty($secret)) {
+ common_log(
+ LOG_WARNING,
+ "Couldn't find Facebook application ID!",
+ __FILE__
+ );
+ }
+
return new Facebook(
array(
'appId' => $appId,