Fix a warning when viewing a revision not attached to a repository
Summary: We'll get a typehint warning on the repository if there's no repository. Check outside the method instead. Test Plan: Loaded page, no warning. Reviewers: btrahan, vrana, jungejason Reviewed By: vrana CC: aran Differential Revision: https://secure.phabricator.com/D2194
This commit is contained in:
parent
fe9ba6bc67
commit
5f615c1e6e
|
@ -269,10 +269,14 @@ final class DifferentialRevisionViewController extends DifferentialController {
|
||||||
$local_view->setUser($user);
|
$local_view->setUser($user);
|
||||||
$local_view->setLocalCommits(idx($props, 'local:commits'));
|
$local_view->setLocalCommits(idx($props, 'local:commits'));
|
||||||
|
|
||||||
$other_revisions = $this->loadOtherRevisions(
|
if ($repository) {
|
||||||
$changesets,
|
$other_revisions = $this->loadOtherRevisions(
|
||||||
$target,
|
$changesets,
|
||||||
$repository);
|
$target,
|
||||||
|
$repository);
|
||||||
|
} else {
|
||||||
|
$other_revisions = array();
|
||||||
|
}
|
||||||
|
|
||||||
$other_view = null;
|
$other_view = null;
|
||||||
if ($other_revisions) {
|
if ($other_revisions) {
|
||||||
|
@ -737,10 +741,6 @@ final class DifferentialRevisionViewController extends DifferentialController {
|
||||||
PhabricatorRepository $repository) {
|
PhabricatorRepository $repository) {
|
||||||
assert_instances_of($changesets, 'DifferentialChangeset');
|
assert_instances_of($changesets, 'DifferentialChangeset');
|
||||||
|
|
||||||
if (!$repository) {
|
|
||||||
return array();
|
|
||||||
}
|
|
||||||
|
|
||||||
$paths = array();
|
$paths = array();
|
||||||
foreach ($changesets as $changeset) {
|
foreach ($changesets as $changeset) {
|
||||||
$paths[] = $changeset->getAbsoluteRepositoryPath(
|
$paths[] = $changeset->getAbsoluteRepositoryPath(
|
||||||
|
|
Loading…
Reference in a new issue