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));