Fix "Trying to get property of non-object" errors when accessing the people search results page

This commit is contained in:
Jeffery To 2009-06-12 19:55:41 +08:00
parent 1b76df4b6a
commit cfea2b0c4e
2 changed files with 2 additions and 2 deletions

View File

@ -56,7 +56,7 @@ class PeopleSearchResults extends ProfileList
function __construct($profile, $terms, $action)
{
parent::__construct($profile, $terms, $action);
parent::__construct($profile, null, $action);
$this->terms = array_map('preg_quote',
array_map('htmlspecialchars', $terms));
$this->pattern = '/('.implode('|',$terms).')/i';

View File

@ -208,7 +208,7 @@ class ProfileList extends Widget
}
$this->out->elementEnd('li');
$this->out->elementStart('li', 'entity_block');
if ($user->id == $this->owner->id) {
if ($this->owner && $user->id == $this->owner->id) {
$this->showBlockForm();
}
$this->out->elementEnd('li');