mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Catching exception when multiple routes with the same name are registered
--HG-- branch : 1.x
This commit is contained in:
@@ -97,8 +97,16 @@ namespace Orchard.Mvc.Routes {
|
|||||||
IsHttpRoute = routeDescriptor is HttpRouteDescriptor,
|
IsHttpRoute = routeDescriptor is HttpRouteDescriptor,
|
||||||
SessionState = sessionStateBehavior
|
SessionState = sessionStateBehavior
|
||||||
};
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
_routeCollection.Add(routeDescriptor.Name, shellRoute);
|
_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.
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user