Server Error in '/' Application.

Length cannot be less than zero.
Parameter name: length

Description: An unhandled exception occurred.

Exception Details: System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length

Source Error:


Line 162:                                        }
Line 163:
Line 164:                                        var facetUrl = Url.AddToFacets2(facet.Name, isInventoryFacet ? "true" : value.Name.Replace("&", "^and^"));
Line 165:                                        if (facetUrl.IndexOf('?') > -1)
Line 166:                                        {

Source File: d:\websites\prod-sc.americanstandard-us.com\LXLCustomViews\Commerce\Catalog\ProductFacets.cshtml    Line: 164

Stack Trace:


[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
   System.String.Substring(Int32 startIndex, Int32 length) +382
   Sitecore.Commerce.XA.Foundation.Common.UrlManager.QueryStringCollection.Parse(String queryString) +195
   LXL.Foundation.Search.LXLUrlExtensionMethods.GetFacetQueryString(String facetQuery, String facetName, String facetValue) in C:\Projects\Lixil\src\Foundation\Search\LXLUrlExtensionMethods.cs:61
   LXL.Foundation.Search.LXLUrlExtensionMethods.AddToFacets2(UrlHelper helper, String facetName, String facetValue) in C:\Projects\Lixil\src\Foundation\Search\LXLUrlExtensionMethods.cs:36
   ASP._Page_LXLCustomViews_Commerce_Catalog_ProductFacets_cshtml.Execute() in d:\websites\prod-sc.americanstandard-us.com\LXLCustomViews\Commerce\Catalog\ProductFacets.cshtml:164
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +107
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +352
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +88
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +775
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +775
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +2282


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.4087.0