From edfdf2c130661002da07e4b615c6de7c5417e8ee Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 27 Apr 2020 10:33:20 -0700 Subject: [PATCH] (stable) Fix a Diffusion issue where commits that do not show changesets would incorrectly try to render changesets Summary: See . Commits with no changesets (for example, deleted commits) don't generate a "$changesets". Test Plan: Viewed a commit with no changesets. Before change: exception. After change: saw unusual commit state. Differential Revision: https://secure.phabricator.com/D21175 --- .../diffusion/controller/DiffusionCommitController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php index 4454cb69d3..970999853c 100644 --- a/src/applications/diffusion/controller/DiffusionCommitController.php +++ b/src/applications/diffusion/controller/DiffusionCommitController.php @@ -459,9 +459,12 @@ final class DiffusionCommitController extends DiffusionController { $filetree = id(new DifferentialFileTreeEngine()) ->setViewer($viewer) - ->setChangesets($changesets) ->setDisabled(!$show_changesets); + if ($show_changesets) { + $filetree->setChangesets($changesets); + } + $description_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Description')) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)