From 03d0e3fdbc890ca9670e8caaf20aa39ebd61d04b Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 21 Apr 2017 14:46:51 -0700 Subject: [PATCH] Fix fatal in Conpherence NUX state Summary: Fixes T12619. Test Plan: Faked `return array()` in ConpherneceThreadQuery, got a NUX instead of fatal. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12619 Differential Revision: https://secure.phabricator.com/D17764 --- .../controller/ConpherenceListController.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/applications/conpherence/controller/ConpherenceListController.php b/src/applications/conpherence/controller/ConpherenceListController.php index fc73d98341..d993a1bd5e 100644 --- a/src/applications/conpherence/controller/ConpherenceListController.php +++ b/src/applications/conpherence/controller/ConpherenceListController.php @@ -89,13 +89,14 @@ final class ConpherenceListController extends ConpherenceController { default: $data = $this->loadDefaultParticipation($limit); $all_participation = $data['all_participation']; - - $conpherence_id = head($all_participation)->getConpherencePHID(); - $conpherence = id(new ConpherenceThreadQuery()) - ->setViewer($user) - ->withPHIDs(array($conpherence_id)) - ->needProfileImage(true) - ->executeOne(); + if ($all_participation) { + $conpherence_id = head($all_participation)->getConpherencePHID(); + $conpherence = id(new ConpherenceThreadQuery()) + ->setViewer($user) + ->withPHIDs(array($conpherence_id)) + ->needProfileImage(true) + ->executeOne(); + } // If $conpherence is null, NUX state will render break; }