Minor bugfix in User class.
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Tue, 23 Aug 2011 22:55:07 +0000 (00:55 +0200)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Thu, 8 Sep 2011 23:14:46 +0000 (01:14 +0200)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
classes/user.php

index bd58db8..eb3c855 100644 (file)
@@ -363,7 +363,7 @@ class User extends PlUser
         if (!$this->_profile_fetched || $forceFetch) {
             $this->_profile_fetched = true;
             $this->_profile = Profile::get($this, $fields, $visibility);
-        } else if (!$this->_profile->visibility->equals($visibility)) {
+        } else if ($this->_profile !== null && !$this->_profile->visibility->equals($visibility)) {
             return Profile::get($this, $fields, $visibility);
         }
         return $this->_profile;