From ec068ff4533287f54aa246b6c8ec73c7dcb0bee9 Mon Sep 17 00:00:00 2001 From: vrana Date: Wed, 2 May 2012 17:26:09 -0700 Subject: [PATCH] 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 --- .../DifferentialRevisionStatusFieldSpecification.php | 3 +++ .../differential/storage/diff/DifferentialDiff.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/applications/differential/field/specification/revisionstatus/DifferentialRevisionStatusFieldSpecification.php b/src/applications/differential/field/specification/revisionstatus/DifferentialRevisionStatusFieldSpecification.php index 5fae5f7f0d..d79a7d4f63 100644 --- a/src/applications/differential/field/specification/revisionstatus/DifferentialRevisionStatusFieldSpecification.php +++ b/src/applications/differential/field/specification/revisionstatus/DifferentialRevisionStatusFieldSpecification.php @@ -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) { diff --git a/src/applications/differential/storage/diff/DifferentialDiff.php b/src/applications/differential/storage/diff/DifferentialDiff.php index 6affe5bf98..ac27cb2d19 100644 --- a/src/applications/differential/storage/diff/DifferentialDiff.php +++ b/src/applications/differential/storage/diff/DifferentialDiff.php @@ -91,6 +91,9 @@ final class DifferentialDiff extends DifferentialDAO { return null; } $repository = $arcanist_project->loadRepository(); + if (!$repository) { + return null; + } return $repository->getVersionControlSystem(); }