Don't issue unnecssary query when loading user profile images
Summary: Fixes T2264. Test Plan: Loaded profile. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2264 Differential Revision: https://secure.phabricator.com/D4324
This commit is contained in:
@@ -630,9 +630,11 @@ EOBODY;
|
||||
public function loadProfileImageURI() {
|
||||
$src_phid = $this->getProfileImagePHID();
|
||||
|
||||
$file = id(new PhabricatorFile())->loadOneWhere('phid = %s', $src_phid);
|
||||
if ($file) {
|
||||
return $file->getBestURI();
|
||||
if ($src_phid) {
|
||||
$file = id(new PhabricatorFile())->loadOneWhere('phid = %s', $src_phid);
|
||||
if ($file) {
|
||||
return $file->getBestURI();
|
||||
}
|
||||
}
|
||||
|
||||
return self::getDefaultProfileImageURI();
|
||||
|
||||
Reference in New Issue
Block a user