1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 12:30:56 +01:00

Fix an issue with ConduitQueryConduitAPIMethod

Fixes an issue with D9991. A user was hitting the following exception:

```
echo '{}' | arc --conduit-uri='http://phabricator.joshuaspence.com'
call-conduit conduit.query
Waiting for JSON parameters on stdin...
Exception
[HTTP/500] Internal Server Error
>>> UNRECOVERABLE FATAL ERROR <<<

Call to a member function getAPIMethodName() on a non-object

/usr/src/phabricator/src/applications/conduit/method/ConduitQueryConduitAPIMethod.php:34

┻━┻ ︵ ¯\_(ツ)_/¯ ︵ ┻━┻
(Run with --trace for a full exception trace.)
```

Auditors: epriestley
This commit is contained in:
Joshua Spence 2014-07-25 15:52:15 +10:00
parent da49ae8fe2
commit 8ce35e6b67

View file

@ -27,15 +27,15 @@ final class ConduitQueryConduitAPIMethod extends ConduitAPIMethod {
->setAncestorClass('ConduitAPIMethod')
->setType('class')
->setConcreteOnly(true)
->selectSymbolsWithoutLoading();
->loadObjects();
$names_to_params = array();
foreach ($classes as $class) {
$method_name = $class['name'];
$obj = newv($method_name, array());
$names_to_params[$this->getAPIMethodNameFromClassName($method_name)] =
array('params' => $obj->defineParamTypes());
$names_to_params[$class->getAPIMethodName()] = array(
'params' => $class->defineParamTypes(),
);
}
return $names_to_params;
}