mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +01:00
Fix a bug where Phortune could fatal while building crumbs
Summary: Ref T12451. `$this->getAccount()` may not return an account. Test Plan: - Visit `/phortune/X/`, where `X` is the ID of an account you don't have permission to view. - Before patch: fatal. - After patch: normal policy exception page. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12451 Differential Revision: https://secure.phabricator.com/D17689
This commit is contained in:
parent
1e43d57c81
commit
7274e4857c
1 changed files with 6 additions and 5 deletions
|
@ -32,13 +32,14 @@ abstract class PhortuneAccountProfileController
|
|||
}
|
||||
|
||||
protected function buildApplicationCrumbs() {
|
||||
$account = $this->getAccount();
|
||||
$id = $account->getID();
|
||||
$account_uri = $this->getApplicationURI("/{$id}/");
|
||||
|
||||
$crumbs = parent::buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb($account->getName(), $account_uri);
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$account = $this->getAccount();
|
||||
if ($account) {
|
||||
$crumbs->addTextCrumb($account->getName(), $account->getURI());
|
||||
}
|
||||
|
||||
return $crumbs;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue