1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-02-02 09:58:23 +01:00

Fix an issue with "arc nrabch"

Summary:
Fixes a minor issue from D14034. PHP doesn't like `clone null;`, and if you type a nonsense command like `arc nbrhch` (as I frequently do) we try to `clone null` here.

Instead, just `return null;` if no workflow matches. Clone otherwise.

Test Plan:
  - Ran `arc nbrhcanc`
  - Ran `arc branch`

Reviewers: BYK, chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D14112
This commit is contained in:
epriestley 2015-09-15 11:14:07 -07:00
parent 61fa644c4e
commit 083127c4cc

View file

@ -31,7 +31,13 @@ class ArcanistConfiguration extends Phobject {
$command = 'version';
}
return clone idx($this->buildAllWorkflows(), $command);
$workflow = idx($this->buildAllWorkflows(), $command);
if (!$workflow) {
return null;
}
return clone $workflow;
}
public function buildAllWorkflows() {