Avoid fatal error if there's no Arcanist project or repository
Test Plan: Display diff without repository Reviewers: nh, epriestley Reviewed By: epriestley CC: aran, Koolvin Differential Revision: https://secure.phabricator.com/D2373
This commit is contained in:
@@ -35,6 +35,9 @@ final class DifferentialRevisionStatusFieldSpecification
|
||||
$info = null;
|
||||
$local_vcs = $diff->getSourceControlSystem();
|
||||
$backing_vcs = $diff->getBackingVersionControlSystem();
|
||||
if (!$backing_vcs) {
|
||||
$backing_vcs = $local_vcs;
|
||||
}
|
||||
|
||||
if ($status == ArcanistDifferentialRevisionStatus::ACCEPTED) {
|
||||
if ($local_vcs == $backing_vcs) {
|
||||
|
||||
@@ -91,6 +91,9 @@ final class DifferentialDiff extends DifferentialDAO {
|
||||
return null;
|
||||
}
|
||||
$repository = $arcanist_project->loadRepository();
|
||||
if (!$repository) {
|
||||
return null;
|
||||
}
|
||||
return $repository->getVersionControlSystem();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user