From df76ed9545f82c882ebf7b68766e5089991ef4a5 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Tue, 20 Nov 2012 17:19:26 -0800 Subject: [PATCH] be careful of received mail object in error cases too Summary: we're tracking down a fatal caused by the mandatory attachments array parameter change in the reply handler and yo dawg, heard you like to fatal in your fatal. Test Plan: internal test scenario with xmail -> phabricator triggered manually. Reviewers: nh, vrana, epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D4005 --- src/applications/differential/DifferentialReplyHandler.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/applications/differential/DifferentialReplyHandler.php b/src/applications/differential/DifferentialReplyHandler.php index d0b8379ea7..4b10033b8e 100644 --- a/src/applications/differential/DifferentialReplyHandler.php +++ b/src/applications/differential/DifferentialReplyHandler.php @@ -147,10 +147,15 @@ class DifferentialReplyHandler extends PhabricatorMailReplyHandler { return $comment->getID(); } catch (Exception $ex) { + if ($this->receivedMail) { + $error_body = $this->receivedMail->getRawTextBody(); + } else { + $error_body = $body; + } $exception_mail = new DifferentialExceptionMail( $this->getMailReceiver(), $ex, - $this->receivedMail->getRawTextBody()); + $error_body); $exception_mail->setToPHIDs(array($this->getActor()->getPHID())); $exception_mail->send();