From e7e585820b960152c95e18ff623aae02af94564f Mon Sep 17 00:00:00 2001 From: J Rhodes Date: Mon, 1 Jun 2015 00:39:57 +1000 Subject: [PATCH] Prevent an error when the Drydock lease artifact does not exist Summary: If a host artifact exists in a Harbormaster build, where the Drydock lease no longer exists, then an error will be raised because of the attempt to access an undefined index. This changes the code to use `idx()` so that it correctly returns null instead. Test Plan: Tested in production. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: joshuaspence, Korvin, epriestley Differential Revision: https://secure.phabricator.com/D13074 --- .../harbormaster/storage/build/HarbormasterBuildArtifact.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php b/src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php index 47df26131c..f96ed6243c 100644 --- a/src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php @@ -77,7 +77,7 @@ final class HarbormasterBuildArtifact extends HarbormasterDAO ->setViewer($viewer) ->withIDs(array($data['drydock-lease'])) ->execute(); - $lease = $leases[$data['drydock-lease']]; + $lease = idx($leases, $data['drydock-lease']); return id(new PHUIObjectItemView()) ->setObjectName(pht('Drydock Lease'))