1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 12:00:55 +01:00

Prevent buildable list in Harbormaster from breaking when container or buildables are missing

Summary: Ref T1049.  I'm fair sure this is just a case of bad data in my local install, but we probably don't want the default page for Harbormaster to break when there's invalid / missing container or buildable handles on any of the builds.

Test Plan: Loaded the page, didn't get a crash due to null reference.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: demo, epriestley, Korvin

Maniphest Tasks: T1049

Differential Revision: https://secure.phabricator.com/D8608
This commit is contained in:
James Rhodes 2014-03-25 17:35:48 -07:00 committed by epriestley
parent e8e12910a7
commit fc3b5ddce6

View file

@ -37,8 +37,12 @@ final class HarbormasterBuildableListController
$item = id(new PHUIObjectItemView())
->setHeader(pht('Buildable %d', $buildable->getID()));
$item->addAttribute($buildable->getContainerHandle()->getName());
$item->addAttribute($buildable->getBuildableHandle()->getFullName());
if ($buildable->getContainerHandle() !== null) {
$item->addAttribute($buildable->getContainerHandle()->getName());
}
if ($buildable->getBuildableHandle() !== null) {
$item->addAttribute($buildable->getBuildableHandle()->getFullName());
}
if ($id) {
$item->setHref("/B{$id}");