Test user equality better in Profile->getUser()

This commit is contained in:
Martin Lyth 2016-07-02 15:45:42 -04:00
parent d7a29be3ac
commit a62755182c
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ class Profile extends Managed_DataObject
throw new NoSuchUserException(array('id'=>$this->id));
}
$cur_user = common_current_user();
if ($user->id === $cur_user->id) {
if (($cur_user instanceof User) && $cur_user->sameAS($this)) {
$user = $cur_user;
}
$this->_user[$this->id] = $user;