2

Closed

HttpRouteDescriptor issues with LookupRouteValues in Orchard.Alias

description

LookupRouteValues inside Orchard.Alias.Implementation.Utils will through an error if you have a route of type HttpRouteDescriptor like
new HttpRouteDescriptor {
                        Name = "categories",
                        RouteTemplate = "v1/categories",
                        Defaults = new { 
                                action = "GetCategories",
                                area = "LoadIn.Grapto.Categories",
                                controller = "oData"
                            },
                        }
becuase HttpRouteDescriptor has a null Route value.

Workaround is to change
            var matches = routeDescriptors
                .Select(routeDescriptor => routeDescriptor.Route.GetRouteData(lookupContext))
                .Where(routeData => routeData != null)
                .Select(data => ToRouteValues(data, queryString));
to
            var matches = routeDescriptors
                .Where(routeDescriptor => routeDescriptor.Route != null)
                .Select(routeDescriptor => routeDescriptor.Route.GetRouteData(lookupContext))
                .Where(routeData => routeData != null)
                .Select(data => ToRouteValues(data, queryString));
Closed Apr 20, 2013 at 10:20 PM by pszmyd
Fixed in changeset 112737fbbe71.

comments