summaryrefslogtreecommitdiff
path: root/lib/noticesection.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/noticesection.php')
-rw-r--r--lib/noticesection.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/noticesection.php b/lib/noticesection.php
index aa8e03229..94c2738ef 100644
--- a/lib/noticesection.php
+++ b/lib/noticesection.php
@@ -73,6 +73,11 @@ class NoticeSection extends Section
function showNotice($notice)
{
$profile = $notice->getProfile();
+ if (empty($profile)) {
+ common_log(LOG_WARNING, sprintf("Notice %d has no profile",
+ $notice->id));
+ return;
+ }
$this->out->elementStart('li', 'hentry notice');
$this->out->elementStart('div', 'entry-title');
$avatar = $profile->getAvatar(AVATAR_MINI_SIZE);
@@ -82,7 +87,7 @@ class NoticeSection extends Section
$profile->nickname,
'href' => $profile->profileurl,
'class' => 'url'));
- $this->out->element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)),
+ $this->out->element('img', array('src' => (($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_MINI_SIZE)),
'width' => AVATAR_MINI_SIZE,
'height' => AVATAR_MINI_SIZE,
'class' => 'avatar photo',
@@ -96,7 +101,7 @@ class NoticeSection extends Section
$this->out->elementStart('p', 'entry-content');
$this->out->raw($notice->rendered);
$this->out->elementEnd('p');
- if ($notice->value) {
+ if (!empty($notice->value)) {
$this->out->elementStart('p');
$this->out->text($notice->value);
$this->out->elementEnd('p');