Commit 86d6abe9 authored by epriestley's avatar epriestley
Browse files

Fix an issue where builds with no initiator failed to render in build plans

Summary: See PHI1743. If a build has no initiator PHID, the rendering pathway incorrectly tries to access a handle for it anyway.

Test Plan:
  - Set a build to have no initiator PHID.
  - Viewed the build plan for the build.
  - Before: fatal when trying to access the `null` handle.
  - After: clean build plan rendering.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Differential Revision: https://secure.phabricator.com/D21269
parent 770a5c84
...@@ -34,7 +34,7 @@ final class HarbormasterBuildView ...@@ -34,7 +34,7 @@ final class HarbormasterBuildView
$list = new PHUIObjectItemListView(); $list = new PHUIObjectItemListView();
foreach ($builds as $build) { foreach ($builds as $build) {
$id = $build->getID(); $id = $build->getID();
$initiator = $handles[$build->getInitiatorPHID()];
$buildable_object = $handles[$build->getBuildable()->getBuildablePHID()]; $buildable_object = $handles[$build->getBuildable()->getBuildablePHID()];
$item = id(new PHUIObjectItemView()) $item = id(new PHUIObjectItemView())
...@@ -46,7 +46,9 @@ final class HarbormasterBuildView ...@@ -46,7 +46,9 @@ final class HarbormasterBuildView
->setEpoch($build->getDateCreated()) ->setEpoch($build->getDateCreated())
->addAttribute($buildable_object->getName()); ->addAttribute($buildable_object->getName());
if ($initiator) { $initiator_phid = $build->getInitiatorPHID();
if ($initiator_phid) {
$initiator = $handles[$initiator_phid];
$item->addByline($initiator->renderLink()); $item->addByline($initiator->renderLink());
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment