diff --git a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php --- a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php @@ -126,17 +126,28 @@ $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); - - $properties->addSectionHeader(pht('Description')); - $properties->addTextContent($rendered); + $step = $build_target->getBuildStep(); + + 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 --- a/src/applications/harbormaster/query/HarbormasterBuildTargetQuery.php +++ b/src/applications/harbormaster/query/HarbormasterBuildTargetQuery.php @@ -103,7 +103,7 @@ 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 --- a/src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php @@ -117,7 +117,7 @@ return $this->assertAttached($this->build); } - public function attachBuildStep(HarbormasterBuildStep $step) { + public function attachBuildStep(HarbormasterBuildStep $step = null) { $this->buildStep = $step; return $this; }