From f123abcc5a89eefa7f4e2b98b6320a6daaaf2c61 Mon Sep 17 00:00:00 2001 From: tuomaspelkonen Date: Wed, 6 Jul 2011 08:42:11 -0700 Subject: [PATCH] Prevent using deleted repositories when displaying commits for a revision. Summary: We deleted a repository (I don't remember which one). Some differential revisions where committed to this repository, and opening these revisions show a blank page, because the repository_id is not in the database anymore. This causes the 'ERROR 8: Undefined index: 12 at [phabricator/src/applications/phid/handle/data/PhabricatorObjectHandleData.php:209] ' in our log. Test Plan: Opened a revision which where committed to multiple repositories including the deleted one. Made sure that the page was rendered correctly and there were no messages in the error log. Reviewed By: epriestley Reviewers: epriestley, jungejason CC: aran, epriestley Differential Revision: 598 --- .../phid/handle/data/PhabricatorObjectHandleData.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/applications/phid/handle/data/PhabricatorObjectHandleData.php b/src/applications/phid/handle/data/PhabricatorObjectHandleData.php index 06b99cccb3..f4fb0059d2 100644 --- a/src/applications/phid/handle/data/PhabricatorObjectHandleData.php +++ b/src/applications/phid/handle/data/PhabricatorObjectHandleData.php @@ -202,7 +202,8 @@ class PhabricatorObjectHandleData { $handle = new PhabricatorObjectHandle(); $handle->setPHID($phid); $handle->setType($type); - if (empty($commits[$phid])) { + if (empty($commits[$phid]) || + !isset($callsigns[$repository_ids[$phid]])) { $handle->setName('Unknown Commit'); } else { $commit = $commits[$phid];