Partial fix for owners bug where a package's repository doesn't exist.

Summary: Avoid requesting a non-existent repository...

Test Plan: Delete a repo that has an associated owners package. Then verify that the owners list page no longer throws an exception.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1372

Differential Revision: https://secure.phabricator.com/D2776
This commit is contained in:
20after4
2012-06-18 06:04:20 -07:00
committed by epriestley
parent 6b8295d100
commit fea67c9858

View File

@@ -262,6 +262,7 @@ final class PhabricatorOwnersListController
$pkg_paths = idx($paths, $package->getID(), array()); $pkg_paths = idx($paths, $package->getID(), array());
foreach ($pkg_paths as $key => $path) { foreach ($pkg_paths as $key => $path) {
$repo = $repositories[$path->getRepositoryPHID()]; $repo = $repositories[$path->getRepositoryPHID()];
if ($repo) {
$drequest = DiffusionRequest::newFromDictionary( $drequest = DiffusionRequest::newFromDictionary(
array( array(
'repository' => $repo, 'repository' => $repo,
@@ -279,6 +280,9 @@ final class PhabricatorOwnersListController
'href' => (string) $href, 'href' => (string) $href,
), ),
phutil_escape_html($path->getPath())); phutil_escape_html($path->getPath()));
} else {
$pkg_paths[$key] = phutil_escape_html($path->getPath());
}
} }
$pkg_paths = implode('<br />', $pkg_paths); $pkg_paths = implode('<br />', $pkg_paths);