1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 08:42:41 +01:00

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:
epriestley 2012-04-10 13:34:31 -07:00
parent fe9ba6bc67
commit 5f615c1e6e

View file

@ -269,10 +269,14 @@ final class DifferentialRevisionViewController extends DifferentialController {
$local_view->setUser($user);
$local_view->setLocalCommits(idx($props, 'local:commits'));
$other_revisions = $this->loadOtherRevisions(
$changesets,
$target,
$repository);
if ($repository) {
$other_revisions = $this->loadOtherRevisions(
$changesets,
$target,
$repository);
} else {
$other_revisions = array();
}
$other_view = null;
if ($other_revisions) {
@ -737,10 +741,6 @@ final class DifferentialRevisionViewController extends DifferentialController {
PhabricatorRepository $repository) {
assert_instances_of($changesets, 'DifferentialChangeset');
if (!$repository) {
return array();
}
$paths = array();
foreach ($changesets as $changeset) {
$paths[] = $changeset->getAbsoluteRepositoryPath(