fixes a single vs first check with render route handler when there might be duplicate routes assigned to a controller

This commit is contained in:
Shannon
2014-07-16 13:41:02 +10:00
parent 0c2d1f72b9
commit 39ee22cbd6

View File

@@ -228,8 +228,9 @@ namespace Umbraco.Web.Mvc
// If more than one route is found, find one with a matching action
if (surfaceRoutes.Count() > 1)
{
surfaceRoute = surfaceRoutes.SingleOrDefault(x =>
x.Defaults["action"].ToString().InvariantEquals(postedInfo.ActionName));
surfaceRoute = surfaceRoutes.FirstOrDefault(x =>
x.Defaults["action"] != null &&
x.Defaults["action"].ToString().InvariantEquals(postedInfo.ActionName));
}
else
{