diff options
author | Zach Copley <zach@controlyourself.ca> | 2009-01-23 05:47:34 +0000 |
---|---|---|
committer | Zach Copley <zach@controlyourself.ca> | 2009-01-23 05:47:34 +0000 |
commit | 36d55526d34e8821d27079f67cbc1b923ac3155d (patch) | |
tree | e487b30cc6cc1e39a201c4321a06cfaab53fd38b /actions/facebookhome.php | |
parent | df25b5f5f533a768532263786c73e4b1356da6fd (diff) |
trac750 fix for crash when a user logs in and hasn't already posted a notice
Diffstat (limited to 'actions/facebookhome.php')
-rw-r--r-- | actions/facebookhome.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/actions/facebookhome.php b/actions/facebookhome.php index b05e51b91..e8c10c9ed 100644 --- a/actions/facebookhome.php +++ b/actions/facebookhome.php @@ -57,29 +57,30 @@ class FacebookhomeAction extends FacebookAction $this->user = $this->flink->getUser(); // If this is the first time the user has started the app - // prompt for Facebook status update permission - if (!$this->facebook->api_client->users_hasAppPermission('status_update')) { + // prompt for Facebook status update permission + if (!$this->facebook->api_client->users_hasAppPermission('status_update')) { if ($this->facebook->api_client->data_getUserPreference( - FACEBOOK_PROMPTED_UPDATE_PREF) != 'true') { - $this->getUpdatePermission(); - return; + FACEBOOK_PROMPTED_UPDATE_PREF) != 'true') { + $this->getUpdatePermission(); + return; } } // Make sure the user's profile box has the lastest notice $notice = $this->user->getCurrentNotice(); - $this->updateProfileBox($notice); + if ($notice) { + $this->updateProfileBox($notice); + } - if ($this->arg('status_submit') == 'Send') { + if ($this->arg('status_submit') == 'Send') { $this->saveNewNotice(); - } + } // User is authenticated and has already been prompted once for // Facebook status update permission? Then show the main page // of the app $this->showPage(); - } else { |