summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2008-09-26 10:50:08 -0400
committerEvan Prodromou <evan@controlyourself.ca>2008-09-26 10:50:08 -0400
commit7ff02bb7d4483b3dc24edd78551a3936798056a8 (patch)
tree38310dbf82738f2eb9c6d49ab796132c837378f6
parentcb265a2d8d475f024e25b56cd3632e381d8dd804 (diff)
try to clean up user-without-profile errors
darcs-hash:20080926145008-5ed1f-8a60ed3c5adbfe75aa044732e8d10dbdb9b93089.gz
-rw-r--r--actions/allrss.php3
-rw-r--r--actions/noticesearch.php1
-rw-r--r--actions/profilesettings.php6
-rw-r--r--actions/remotesubscribe.php7
-rw-r--r--actions/repliesrss.php3
-rw-r--r--actions/showstream.php5
-rw-r--r--actions/userauthorization.php5
-rw-r--r--actions/userrss.php5
8 files changed, 35 insertions, 0 deletions
diff --git a/actions/allrss.php b/actions/allrss.php
index 9cbfe8dc8..e49ac5540 100644
--- a/actions/allrss.php
+++ b/actions/allrss.php
@@ -68,6 +68,9 @@ class AllrssAction extends Rss10Action {
function get_image() {
$user = $this->user;
$profile = $user->getProfile();
+ if (!$profile) {
+ return NULL;
+ }
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
return ($avatar) ? $avatar->url : NULL;
}
diff --git a/actions/noticesearch.php b/actions/noticesearch.php
index 7022109e6..e6de21ae0 100644
--- a/actions/noticesearch.php
+++ b/actions/noticesearch.php
@@ -92,6 +92,7 @@ class NoticesearchAction extends SearchAction {
$profile = $notice->getProfile();
if (!$profile) {
common_log_db_error($notice, 'SELECT', __FILE__);
+ $this->server_error(_('Notice without matching profile'));
return;
}
# XXX: RDFa
diff --git a/actions/profilesettings.php b/actions/profilesettings.php
index 0474c6937..e5698011a 100644
--- a/actions/profilesettings.php
+++ b/actions/profilesettings.php
@@ -110,6 +110,12 @@ class ProfilesettingsAction extends SettingsAction {
$user = common_current_user();
$profile = $user->getProfile();
+ if (!$profile) {
+ common_log_db_error($user, 'SELECT', __FILE__);
+ $this->server_error(_('User without matching profile'));
+ return;
+ }
+
$original = $profile->getOriginalAvatar();
diff --git a/actions/remotesubscribe.php b/actions/remotesubscribe.php
index c2c00ab61..7137b42a2 100644
--- a/actions/remotesubscribe.php
+++ b/actions/remotesubscribe.php
@@ -313,7 +313,14 @@ class RemotesubscribeAction extends Action {
$req->set_parameter('omb_listenee_profile', common_profile_url($user->nickname));
$req->set_parameter('omb_listenee_nickname', $user->nickname);
$req->set_parameter('omb_listenee_license', $config['license']['url']);
+
$profile = $user->getProfile();
+ if (!$profile) {
+ common_log_db_error($user, 'SELECT', __FILE__);
+ $this->server_error(_('User without matching profile'));
+ return;
+ }
+
if ($profile->fullname) {
$req->set_parameter('omb_listenee_fullname', $profile->fullname);
}
diff --git a/actions/repliesrss.php b/actions/repliesrss.php
index 1a12b45bf..b811db7eb 100644
--- a/actions/repliesrss.php
+++ b/actions/repliesrss.php
@@ -84,6 +84,9 @@ class RepliesrssAction extends Rss10Action {
function get_image() {
$user = $this->user;
$profile = $user->getProfile();
+ if (!$profile) {
+ return NULL;
+ }
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
return ($avatar) ? $avatar->url : NULL;
}
diff --git a/actions/showstream.php b/actions/showstream.php
index 2f7c2fb92..43556a0ed 100644
--- a/actions/showstream.php
+++ b/actions/showstream.php
@@ -252,6 +252,11 @@ class ShowstreamAction extends StreamAction {
$other = Profile::staticGet($subs->subscribed);
+ if (!$other) {
+ common_log_db_error($subs, 'SELECT', __FILE__);
+ continue;
+ }
+
common_element_start('li');
common_element_start('a', array('title' => ($other->fullname) ?
$other->fullname :
diff --git a/actions/userauthorization.php b/actions/userauthorization.php
index 735bcb6b5..680f55094 100644
--- a/actions/userauthorization.php
+++ b/actions/userauthorization.php
@@ -154,6 +154,11 @@ class UserauthorizationAction extends Action {
$params['omb_version'] = OMB_VERSION_01;
$user = User::staticGet('uri', $req->get_parameter('omb_listener'));
$profile = $user->getProfile();
+ if (!$profile) {
+ common_log_db_error($user, 'SELECT', __FILE__);
+ $this->server_error(_('User without matching profile'));
+ return;
+ }
$params['omb_listener_nickname'] = $user->nickname;
$params['omb_listener_profile'] = common_local_url('showstream',
array('nickname' => $user->nickname));
diff --git a/actions/userrss.php b/actions/userrss.php
index 2ae45dc9c..e60851915 100644
--- a/actions/userrss.php
+++ b/actions/userrss.php
@@ -74,6 +74,11 @@ class UserrssAction extends Rss10Action {
function get_image() {
$user = $this->user;
$profile = $user->getProfile();
+ if (!$profile) {
+ common_log_db_error($user, 'SELECT', __FILE__);
+ $this->server_error(_('User without matching profile'));
+ return NULL;
+ }
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
return ($avatar) ? $avatar->url : NULL;
}