From: epriestley Date: Tue, 15 Sep 2015 18:14:07 +0000 (-0700) Subject: Fix an issue with "arc nrabch" X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=083127c4cc5aaca09cb2cd829a6a58bc7dc74738;p=arcanist.git 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 --- diff --git a/src/configuration/ArcanistConfiguration.php b/src/configuration/ArcanistConfiguration.php index e66b7936..8761d8cb 100644 --- a/src/configuration/ArcanistConfiguration.php +++ b/src/configuration/ArcanistConfiguration.php @@ -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() {