Catching exception when multiple routes with the same name are registered

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2013-06-10 15:10:02 -07:00
parent d42eb9ceb7
commit eeda28ded8

View File

@@ -97,8 +97,16 @@ namespace Orchard.Mvc.Routes {
IsHttpRoute = routeDescriptor is HttpRouteDescriptor,
SessionState = sessionStateBehavior
};
try {
_routeCollection.Add(routeDescriptor.Name, shellRoute);
}
catch(ArgumentException) {
// Named routes can be added multiple times in the case of a module
// loaded in multiple tenants. There is no way to ensure a named route
// is already registered, thus catching the specific exception.
}
}
}
}
}