From 083127c4cc5aaca09cb2cd829a6a58bc7dc74738 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 15 Sep 2015 11:14:07 -0700 Subject: [PATCH] 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 --- src/configuration/ArcanistConfiguration.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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() {