From f04d3c9e9448e54f14ffc60b967bbe5a934a027c Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Sun, 17 Mar 2013 14:36:22 -0700 Subject: [PATCH] fixing file issue -- files can be deleted --- .../conpherence/query/ConpherenceThreadQuery.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/applications/conpherence/query/ConpherenceThreadQuery.php b/src/applications/conpherence/query/ConpherenceThreadQuery.php index 5c2bc8476d..45895d2ded 100644 --- a/src/applications/conpherence/query/ConpherenceThreadQuery.php +++ b/src/applications/conpherence/query/ConpherenceThreadQuery.php @@ -194,7 +194,13 @@ final class ConpherenceThreadQuery $conpherence_files = array(); $files_authors = array(); foreach ($conpherence->getFilePHIDs() as $curr_phid) { - $conpherence_files[$curr_phid] = $files[$curr_phid]; + $curr_file = idx($files, $curr_phid); + if (!$curr_file) { + // this file was deleted or user doesn't have permission to see it + // this is generally weird + continue; + } + $conpherence_files[$curr_phid] = $curr_file; // some files don't have authors so be careful $current_author = null; $current_author_phid = idx($file_author_phids, $curr_phid);