diff --git a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php index 3ec0d9b1d8..05433c074a 100644 --- a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php @@ -126,17 +126,28 @@ final class HarbormasterBuildViewController $target_box->addPropertyList($properties, pht('Overview')); - $description = $build_target->getBuildStep()->getDescription(); - if ($description) { - $rendered = PhabricatorMarkupEngine::renderOneObject( - id(new PhabricatorMarkupOneOff()) - ->setContent($description) - ->setPreserveLinebreaks(true), - 'default', - $viewer); + $step = $build_target->getBuildStep(); - $properties->addSectionHeader(pht('Description')); - $properties->addTextContent($rendered); + if ($step) { + $description = $step->getDescription(); + if ($description) { + $rendered = PhabricatorMarkupEngine::renderOneObject( + id(new PhabricatorMarkupOneOff()) + ->setContent($description) + ->setPreserveLinebreaks(true), + 'default', + $viewer); + + $properties->addSectionHeader(pht('Description')); + $properties->addTextContent($rendered); + } + } else { + $target_box->setFormErrors( + array( + pht( + 'This build step has since been deleted on the build plan. '. + 'Some information may be omitted.'), + )); } $details = $build_target->getDetails(); diff --git a/src/applications/harbormaster/query/HarbormasterBuildTargetQuery.php b/src/applications/harbormaster/query/HarbormasterBuildTargetQuery.php index 133bb6c0e2..213a6a4a20 100644 --- a/src/applications/harbormaster/query/HarbormasterBuildTargetQuery.php +++ b/src/applications/harbormaster/query/HarbormasterBuildTargetQuery.php @@ -103,7 +103,7 @@ final class HarbormasterBuildTargetQuery foreach ($page as $target) { $target->attachBuildStep( - $steps[$target->getBuildStepPHID()]); + idx($steps, $target->getBuildStepPHID())); } } diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php b/src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php index 1a142dc5cb..8f9a5b7b8e 100644 --- a/src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php @@ -117,7 +117,7 @@ final class HarbormasterBuildTarget extends HarbormasterDAO return $this->assertAttached($this->build); } - public function attachBuildStep(HarbormasterBuildStep $step) { + public function attachBuildStep(HarbormasterBuildStep $step = null) { $this->buildStep = $step; return $this; }