From d33069b1ffd2d6eface77b596044576a74b548e8 Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Thu, 11 Sep 2014 10:25:00 -0700 Subject: [PATCH] #20710:Fixing empty string support in command recipe handler Work Item: 20710 --- .../Orchard.Recipes/RecipeHandlers/CommandRecipeHandler.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Recipes/RecipeHandlers/CommandRecipeHandler.cs b/src/Orchard.Web/Modules/Orchard.Recipes/RecipeHandlers/CommandRecipeHandler.cs index 32c7aff7f..d68241732 100644 --- a/src/Orchard.Web/Modules/Orchard.Recipes/RecipeHandlers/CommandRecipeHandler.cs +++ b/src/Orchard.Web/Modules/Orchard.Recipes/RecipeHandlers/CommandRecipeHandler.cs @@ -67,8 +67,9 @@ namespace Orchard.Recipes.RecipeHandlers { }; foreach (var arg in args) { - // Switch? - if (arg[0] == '/') { + if (arg.StartsWith("/")) { + //If arg is not empty and starts with '/' + int index = arg.IndexOf(':'); var switchName = (index < 0 ? arg.Substring(1) : arg.Substring(1, index - 1)); var switchValue = (index < 0 || index >= arg.Length ? string.Empty : arg.Substring(index + 1));