mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 22:10: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:
parent
e8e12910a7
commit
fc3b5ddce6
1 changed files with 6 additions and 2 deletions
|
@ -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}");
|
||||
|
|
Loading…
Reference in a new issue