From db71bf6128c80e00cc03c76738468f2684ae31fc Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Thu, 10 Oct 2013 15:17:37 -0700 Subject: [PATCH] Fix issue reported from github Summary: we filter the $actors above such that its possible to have no $actor anymore (if $actor is not a deliverable email address). ergo, make sure we have actor before we start calling methods. Fixes github issue 403 Test Plan: logic on this one - not 100% sure how to easily reproduce Reviewers: epriestley Reviewed By: epriestley CC: Korvin, epriestley, aran Differential Revision: https://secure.phabricator.com/D7284 --- .../metamta/storage/PhabricatorMetaMTAMail.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php index 56f751c63d..a6c2e1e08f 100644 --- a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php +++ b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php @@ -383,10 +383,13 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO { switch ($key) { case 'from': $from = $value; - $actor = $actors[$from]; - - $actor_email = $actor->getEmailAddress(); - $actor_name = $actor->getName(); + $actor_email = null; + $actor_name = null; + $actor = idx($actors, $from); + if ($actor) { + $actor_email = $actor->getEmailAddress(); + $actor_name = $actor->getName(); + } $can_send_as_user = $actor_email && PhabricatorEnv::getEnvConfig('metamta.can-send-as-user');