Page MenuHomePhabricator

Argument 1 passed to DifferentialReviewersField::inflateReviewers() must be of the type array, null given
Closed, ResolvedPublic

Description

I just got this error when trying to update a diff with arc diff:

Exception
ERR-CONDUIT-CORE: Argument 1 passed to DifferentialReviewersField::inflateReviewers() must be of the type array, null given, called in /usr/src/phabricator/src/applications/differential/customfield/DifferentialReviewersField.php on line 245 and defined
(Run with `--trace` for a full exception trace.)

The diff was no reviewers set, which I'm guessing is the problem.

Revisions and Commits

Restricted Differential Revision
Restricted Differential Revision

Event Timeline

Phabricator version is rPe1ad312fdd2c570eeaacd3e02eda2142cc5d9849.

From the server logs:

[24-May-2016 08:53:21 Australia/Sydney] [2016-05-24 08:53:21] EXCEPTION: (InvalidArgumentException) Argument 1 passed to DifferentialReviewersField::inflateReviewers() must be of the type array, null given, called in /usr/src/phabricator/src/applications/differential/customfield/DifferentialReviewersField.php on line 245 and defined at [<phutil>/src/error/PhutilErrorHandler.php:200]
[24-May-2016 08:53:21 Australia/Sydney] arcanist(head=master, ref.master=2234c8cacc21), phabricator(head=master, ref.master=e1ad312fdd2c, custom=1), phlab(head=master, ref.master=84b62e6917ec), phutil(head=master, ref.master=bd56873ae4c0)
[24-May-2016 08:53:21 Australia/Sydney]   #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer, array) called at [<phabricator>/src/applications/differential/customfield/DifferentialReviewersField.php:307]
[24-May-2016 08:53:21 Australia/Sydney]   #1 <#2> DifferentialReviewersField::inflateReviewers(NULL) called at [<phabricator>/src/applications/differential/customfield/DifferentialReviewersField.php:245]
[24-May-2016 08:53:21 Australia/Sydney]   #2 <#2> DifferentialReviewersField::validateCommitMessageValue(NULL) called at [<phabricator>/src/applications/differential/conduit/DifferentialParseCommitMessageConduitAPIMethod.php:70]
[24-May-2016 08:53:21 Australia/Sydney]   #3 <#2> DifferentialParseCommitMessageConduitAPIMethod::execute(ConduitAPIRequest) called at [<phabricator>/src/applications/conduit/method/ConduitAPIMethod.php:122]
[24-May-2016 08:53:21 Australia/Sydney]   #4 <#2> ConduitAPIMethod::executeMethod(ConduitAPIRequest) called at [<phabricator>/src/applications/conduit/call/ConduitCall.php:131]
[24-May-2016 08:53:21 Australia/Sydney]   #5 <#2> ConduitCall::executeMethod() called at [<phabricator>/src/applications/conduit/call/ConduitCall.php:81]
[24-May-2016 08:53:21 Australia/Sydney]   #6 <#2> ConduitCall::execute() called at [<phabricator>/src/applications/conduit/controller/PhabricatorConduitAPIController.php:81]
[24-May-2016 08:53:21 Australia/Sydney]   #7 phlog(InvalidArgumentException) called at [<phabricator>/src/applications/conduit/controller/PhabricatorConduitAPIController.php:101]
[24-May-2016 08:53:21 Australia/Sydney]   #8 PhabricatorConduitAPIController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:237]
[24-May-2016 08:53:21 Australia/Sydney]   #9 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:149]
[24-May-2016 08:53:21 Australia/Sydney]   #10 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:17]

This seemed to fix the issue:

diff --git a/src/applications/differential/customfield/DifferentialReviewersField.php b/src/applications/differential/customfield/DifferentialReviewersField.php
index f77f8ab..cb26eba 100644
--- a/src/applications/differential/customfield/DifferentialReviewersField.php
+++ b/src/applications/differential/customfield/DifferentialReviewersField.php
@@ -242,7 +242,7 @@ final class DifferentialReviewersField
     $config_self_accept_key = 'differential.allow-self-accept';
     $allow_self_accept = PhabricatorEnv::getEnvConfig($config_self_accept_key);
 
-    $value = $this->inflateReviewers($value);
+    $value = $this->inflateReviewers(coalesce($value, array()));
     foreach ($value as $spec) {
       $phid = $spec['phid'];
epriestley triaged this task as Normal priority.
epriestley added a revision: Restricted Differential Revision.May 24 2016, 12:06 AM
epriestley closed this task as Resolved by committing Restricted Diffusion Commit.May 24 2016, 12:16 AM
epriestley added a commit: Restricted Diffusion Commit.
epriestley added a commit: Restricted Diffusion Commit.May 25 2016, 6:01 PM